当前位置: 首页>>代码示例>>C#>>正文


C# Shape.DeleteRow方法代码示例

本文整理汇总了C#中Shape.DeleteRow方法的典型用法代码示例。如果您正苦于以下问题:C# Shape.DeleteRow方法的具体用法?C# Shape.DeleteRow怎么用?C# Shape.DeleteRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shape的用法示例。


在下文中一共展示了Shape.DeleteRow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoveRightMouseAction

        // Removes the action associated with using the right mouse on a shape
        private static void RemoveRightMouseAction(Shape targetShape, string menuCaption)
        {
            const string DividerBarPrefix = "_";
            const string AddToBottomPrefix = "%";
            const string AcceleratorPrefix = "&";

            if (menuCaption == null || targetShape == null)
                return;

            short actionRow;
            short actionRows;
            string taggedMenuCaption;
            string rowCaption;
            string cleanMenuCaption;
            Cell actionCell;

            try {
                // the menuCaption string may need to be modified to include a
                // tag that indicates the menu should be at the bottom, or
                // should be preceeded by a separator line.
                taggedMenuCaption = menuCaption;
                if (taggedMenuCaption == null)
                    throw new ArgumentNullException("Menu caption is null");

                // strip modifier tokens from the caption
                cleanMenuCaption = menuCaption.Replace(AcceleratorPrefix, "");

                // Check if the right menu action item already exists.
                actionRows = targetShape.get_RowCount((short)VisSectionIndices.visSectionAction);

                bool actionExists = false;

                for (actionRow = 0; (actionExists == false) && (actionRow < actionRows); actionRow++) {
                    actionCell = targetShape.get_CellsSRC((short)VisSectionIndices.visSectionAction,
                        (short)(VisRowIndices.visRowAction + actionRow),
                        (short)VisCellIndices.visActionMenu);

                    rowCaption = Common.FormulaStringToString(actionCell.FormulaU);

                    // strip modifier tokens from the caption before compare
                    rowCaption = rowCaption.Replace(DividerBarPrefix, "");
                    rowCaption = rowCaption.Replace(AddToBottomPrefix, "");
                    rowCaption = rowCaption.Replace(AcceleratorPrefix, "");

                    if (rowCaption == cleanMenuCaption) {
                        targetShape.DeleteRow((short)VisSectionIndices.visSectionAction, (short)(VisRowIndices.visRowAction + actionRow));
                        actionExists = true;
                    }
                }
            }
            catch (System.Runtime.InteropServices.COMException err) {
                System.Diagnostics.Debug.WriteLine(err.Message);
            }
        }
开发者ID:jeffkosa,项目名称:PathMakerOS_Root,代码行数:55,代码来源:Repair.Support.cs

示例2: RenameRow

 private static void RenameRow(Shape shape, string oldRowName, string newRowName, string newRowLabel)
 {
     if (shape.get_CellExists(oldRowName, (short)VisExistsFlags.visExistsAnywhere) != 0) {
         string tmp = shape.get_Cells(oldRowName).Formula;
         short row = shape.get_CellsRowIndex(oldRowName);
         shape.DeleteRow((short)VisSectionIndices.visSectionProp, row);
         Common.SetCellFormula(shape, newRowName, tmp);
         SetRowLabel(shape, newRowName, newRowLabel);
     }
 }
开发者ID:jeffkosa,项目名称:PathMakerOS_Root,代码行数:10,代码来源:Repair.Support.cs

示例3: DeleteOldPropertyCell

 private static void DeleteOldPropertyCell(Shape shape, string cellName)
 {
     if (shape.get_CellExists(cellName, (short)VisExistsFlags.visExistsAnywhere) != 0) {
         short row = shape.get_CellsRowIndex(cellName);
         shape.DeleteRow((short)VisSectionIndices.visSectionProp, row);
     }
 }
开发者ID:jeffkosa,项目名称:PathMakerOS_Root,代码行数:7,代码来源:Repair.Support.cs


注:本文中的Shape.DeleteRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。