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


C# IVwSelection.get_BoxIndex方法代码示例

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


在下文中一共展示了IVwSelection.get_BoxIndex方法的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);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:72,代码来源:XmlBrowseViewBase.cs


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