本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}