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


C# ISilDataAccess.GetObjIndex方法代码示例

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


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

示例1: GetNextSeg

		/// <summary>
		/// Given that idxCurSeg is the index of a segment of curPara, adjust both until it is the index of the
		/// next segment (possibly in a later paragraph). Return false if no earlier segment exists in
		/// the current text.
		/// </summary
		private static bool GetNextSeg(ref int idxCurSeg, ISilDataAccess sda,
			ref StTxtPara curPara, int ktagParaSegments)
		{
			idxCurSeg++;
			// This for usually exits early in the first iteration, and all we do in the method is increment idxCurSeg.
			// It is even rarer to have more than one full iteration but could happen if there is an empty paragraph.
			for (; ; )
			{
				int csegs = sda.get_VecSize(curPara.Hvo, ktagParaSegments);
				if (idxCurSeg < csegs)
					return true;
				// set curPara to next para in StText. If there is none, fail.
				int idxPara = sda.GetObjIndex(curPara.OwnerHVO, (int)StText.StTextTags.kflidParagraphs, curPara.Hvo);
				int cpara = sda.get_VecSize(curPara.OwnerHVO, (int)StText.StTextTags.kflidParagraphs);
				if (idxPara >= cpara - 1)
					return false;
				int hvoNext = sda.get_VecItem(curPara.OwnerHVO, (int)StText.StTextTags.kflidParagraphs, idxPara + 1);
				curPara = CmObject.CreateFromDBObject(curPara.Cache, hvoNext, false) as StTxtPara;
				idxCurSeg = 0;
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:26,代码来源:InterlinVc.cs

示例2: GetPrevSeg

		/// <summary>
		/// Given that idxCurSeg is the index of a segment of curPara, adjust both until it is the index of the
		/// previous segment (possibly in an earlier paragraph). Return false if no earlier segment exists in
		/// the current text.
		/// </summary
		private static bool GetPrevSeg(ref int idxCurSeg, ISilDataAccess sda,
			ref StTxtPara curPara, int ktagParaSegments)
		{
			idxCurSeg--;
			// This while usually has no iterations, and all we do in the method is decrement idxCurSeg.
			// It is even rarer to have more than one iteration but could happen if there is an empty paragraph.
			while (idxCurSeg < 0)
			{
				// set curPara to previous para in StText. If there is none, fail.
				int idxPara = sda.GetObjIndex(curPara.OwnerHVO, (int)StText.StTextTags.kflidParagraphs, curPara.Hvo);
				if (idxPara == 0)
					return false;
				int hvoPrev = sda.get_VecItem(curPara.OwnerHVO, (int)StText.StTextTags.kflidParagraphs, idxPara - 1);
				curPara = CmObject.CreateFromDBObject(curPara.Cache, hvoPrev, false) as StTxtPara;
				idxCurSeg = sda.get_VecSize(curPara.Hvo, ktagParaSegments) - 1;
			}
			return true;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:23,代码来源:InterlinVc.cs


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