本文整理汇总了C#中IVwSelection.get_BoxCount方法的典型用法代码示例。如果您正苦于以下问题:C# IVwSelection.get_BoxCount方法的具体用法?C# IVwSelection.get_BoxCount怎么用?C# IVwSelection.get_BoxCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVwSelection
的用法示例。
在下文中一共展示了IVwSelection.get_BoxCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCurrentTableCellInfo
/// ------------------------------------------------------------------------------------
/// <summary>
/// Gets the row/cell information of the current selection.
/// </summary>
/// <param name="vwsel"></param>
/// <param name="iLevel"></param>
/// <param name="iBox"></param>
/// <param name="iTableBox"></param>
/// <param name="cTableBoxes"></param>
/// <param name="iTableLevel"></param>
/// <param name="iCellBox"></param>
/// <param name="cCellBoxes"></param>
/// <param name="iCellLevel"></param>
/// ------------------------------------------------------------------------------------
internal static void GetCurrentTableCellInfo(IVwSelection vwsel, out int iLevel, out int iBox, out int iTableBox, out int cTableBoxes, out int iTableLevel, out int iCellBox, out int cCellBoxes, out int iCellLevel)
{
int cBoxes = -1;
iBox = -1;
iTableBox = -1;
cTableBoxes = -1;
iTableLevel = -1;
int iRowBox = -1;
int cRowBoxes = -1;
int iRowLevel = -1;
iCellBox = -1;
cCellBoxes = -1;
iCellLevel = -1;
// Find the current table cell and advance to the next one, possibly on the
// next or previous row.
int cLevels = vwsel.get_BoxDepth(true);
VwBoxType vbt = VwBoxType.kvbtUnknown;
for (iLevel = 0; iLevel < cLevels; ++iLevel)
{
cBoxes = vwsel.get_BoxCount(true, iLevel);
iBox = vwsel.get_BoxIndex(true, iLevel);
vbt = vwsel.get_BoxType(true, iLevel);
switch (vbt)
{
case VwBoxType.kvbtTable:
// Note that the layout should one (visible) row per "table", and
// stacks the "table" boxes to form the visual table. See JohnT
// for an explanation of this nonintuitive use of tables and rows.
// At least, i think JohnT knows why -- maybe it's RandyR?
iTableBox = iBox;
cTableBoxes = cBoxes;
iTableLevel = iLevel;
break;
case VwBoxType.kvbtTableRow:
iRowBox = iBox;
cRowBoxes = cBoxes;
iRowLevel = iLevel;
break;
case VwBoxType.kvbtTableCell:
iCellBox = iBox;
cCellBoxes = cBoxes;
iCellLevel = iLevel;
break;
}
}
// Some simple sanity checking.
Debug.Assert(cBoxes != -1);
Debug.Assert(iBox != -1);
Debug.Assert(iTableBox != -1);
Debug.Assert(cTableBoxes != -1);
Debug.Assert(iTableLevel != -1);
Debug.Assert(iRowBox != -1);
Debug.Assert(cRowBoxes != -1);
Debug.Assert(iRowLevel != -1);
Debug.Assert(iCellBox != -1);
Debug.Assert(cCellBoxes != -1);
Debug.Assert(iCellLevel != -1);
}