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


C# FdoCache.GetTsStringProperty方法代码示例

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


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

示例1: Create

		/// <summary>
		///  Create one from the specified end of the selection. If that end is not in a
		/// relevant property return null. Also return null if in the same StText as
		/// hvoOther.
		/// </summary>
		/// <param name="info"></param>
		/// <param name="fEndPoint"></param>
		static public TextStateInfo Create(TextSelInfo info, bool fEndPoint, FdoCache cache, int hvoOther)
		{
			int offset = 0; // in the SelInfoStack
			if (info.Tag(fEndPoint) == kflidContents)
			{
				if (info.Levels(fEndPoint) < 2)
					return null;
			}
			else
			{
				// One other case we need to handle is an embedded picture, because deleting it will modify the string.
				if (!info.IsPicture || info.Levels(false) < 3 || info.ContainingObjectTag(1) != kflidContents)
					return null;
				offset = 1; // one more level for the picture.
			}
			int hvoStText = info.ContainingObject(1 + offset, fEndPoint);
			if (hvoStText == hvoOther)
				return null;
			TextStateInfo result = new TextStateInfo();
			result.m_stText = CmObject.CreateFromDBObject(cache, hvoStText) as StText;;
			result.m_hvoPara = info.ContainingObject(offset, fEndPoint);
			foreach (StTxtPara para in result.m_stText.ParagraphsOS)
				result.m_paras.Add(new ParaStateInfo(para));
			result.m_tssAnchorText = cache.GetTsStringProperty(result.m_hvoPara, kflidContents);
			result.m_fCheckOtherParasOfText = true;
			return result;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:34,代码来源:AnnotationAdjuster.cs

示例2: AddStringFromOtherObj

		internal static string[] AddStringFromOtherObj(XmlNode frag, int hvoTarget, FdoCache cache)
		{
			int flid = XmlVc.GetFlid(frag, hvoTarget, cache);
			ITsStrFactory tsf = TsStrFactoryClass.Create();
			FieldType itype = cache.GetFieldType(flid);
			if ((itype == FieldType.kcptUnicode) ||
				(itype == FieldType.kcptBigUnicode))
			{
				return new string[] {cache.GetUnicodeProperty(hvoTarget, flid)};
			}
			else if ((itype == FieldType.kcptString) ||
				(itype == FieldType.kcptBigString))
			{
				return new string[] { cache.GetTsStringProperty(hvoTarget, flid).Text };
			}
			else // multistring of some type
			{
				int wsid = 0;
				string sep = "";
				if (s_cwsMulti > 1)
				{
					string sLabelWs = XmlUtils.GetOptionalAttributeValue(frag, "ws");
					if (sLabelWs != null && sLabelWs == "current")
					{
						sep = DisplayMultiSep(frag, cache)
							+ DisplayWsLabel(s_qwsCurrent, cache);
						wsid = s_qwsCurrent.WritingSystem;
					}
				}
				if (wsid == 0)
					wsid = LangProject.GetWritingSystem(frag, cache, null, LangProject.kwsAnal);
				if ((itype == FieldType.kcptMultiUnicode) ||
					(itype == FieldType.kcptMultiBigUnicode))
				{
					return new string[] {sep, cache.GetMultiUnicodeAlt(hvoTarget, flid, wsid, null) };
				}
				else
				{
					return new string[] {sep, cache.GetMultiStringAlt(hvoTarget, flid, wsid).Text };
				}
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:42,代码来源:XmlViewsUtils.cs

示例3: GetWsAtParaOffset

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Gets the ws at para offset.
		/// </summary>
		/// <param name="cache">The cache.</param>
		/// <param name="hvoPara">The hvo para.</param>
		/// <param name="ichBeginOffset">The ich begin offset.</param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		public static int GetWsAtParaOffset(FdoCache cache, int hvoPara, int ichBeginOffset)
		{
			//Debug.Assert(cache.IsValidObject(hvoPara, StTxtPara.kClassId),
			//    String.Format("expected valid hvo({0}).", hvoPara));
			//if (hvoPara <= 0 && !cache.IsDummyObject(hvoPara))
			//    throw new ArgumentException(String.Format("expected valid hvo({0}).", hvoPara));
			ITsString tssPara = cache.GetTsStringProperty(hvoPara, (int)StTxtPara.StTxtParaTags.kflidContents);
			int ws = StringUtils.GetWsAtOffset(tssPara, ichBeginOffset);
			return ws;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:19,代码来源:StTxtPara.cs

示例4: AnnotationTargetString

		internal static ITsString AnnotationTargetString(int hvoTarget, int flid, int ws, FdoCache cache)
		{
			ITsString tssValue;
			if (IsMultilingual(flid))
			{
				tssValue = cache.GetMultiStringAlt(hvoTarget, flid, ws);
			}
			else
			{
				tssValue = cache.GetTsStringProperty(hvoTarget, flid);
			}
			return tssValue;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:13,代码来源:RespellerDlg.cs


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