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


C# ITsTextProps.GetStrPropValue方法代码示例

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


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

示例1: GetFootnoteFromProps

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Gets footnote hvo from reference in text properties
		/// </summary>
		/// <param name="cache"></param>
		/// <param name="tprops"></param>
		/// <returns>Hvo of the footnote that was found or 0 if none was found</returns>
		/// ------------------------------------------------------------------------------------
		protected static int GetFootnoteFromProps(FdoCache cache, ITsTextProps tprops)
		{
			string footnoteRef =
				tprops.GetStrPropValue((int)FwTextPropType.ktptObjData);

			if (footnoteRef != null)
			{
				// first char. of strData is type code - GUID will follow it.
				Guid objGuid = MiscUtils.GetGuidFromObjData(footnoteRef.Substring(1));

				int hvo = cache.GetIdFromGuid(objGuid);
				if (hvo > 0 && cache.GetClassOfObject(hvo) == StFootnote.kClassId)
					return hvo;
			}
			return 0;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:24,代码来源:ScrFootnote.cs

示例2: ChangeParagraphStyle

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Change the paragraph style.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		protected override void ChangeParagraphStyle(ISilDataAccess sda, ITsTextProps ttp, int hvoPara)
		{
			if (ttp != null)
			{
				string style = ttp.GetStrPropValue((int)FwTextPropType.ktptNamedStyle);
				string undo, redo;
				ResourceHelper.MakeUndoRedoLabels("kstidUndoStyleChanges", out undo, out redo);
				undo = string.Format(undo, style);
				redo = string.Format(redo, style);
				UndoableUnitOfWorkHelper.DoUsingNewOrCurrentUOW(undo, redo,
					Cache.ServiceLocator.GetInstance<IActionHandler>(),
					() => CallBaseChangeParagraphStyle(sda, ttp, hvoPara));
			}

		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:20,代码来源:RootSiteEditingHelper.cs

示例3: ApplyTextProps

		/// <summary>
		/// Compute the assembled styles that results from applying the properties specified in the text props to this.
		/// We might start with a root assembled styles that says to use a 10-point font,
		/// then apply a paragraph style which says to use a 12-point font, except for French use 14-point.
		/// Then in another text props we may tell it the writing system is French, and must get 14-point as the
		/// result. Or, in a single TsTextProps, we may tell it the WS is French and to apply a character
		/// style which says to use 16-point, except for French 18-point; the result needs to be 18-point.
		/// It's also theoretically possible that the same text props again says directly to use 20-point; that
		/// should win over all the others.
		/// We achieve most of this by simply looking for the ws, then the named style, then everything else
		/// (and when we process a style, if we already know a ws we include the overrides for that ws).
		/// However, when we process the paragraph style, we don't know what ws a run in that paragraph will have.
		/// </summary>
		/// <param name="props"></param>
		/// <returns></returns>
		public AssembledStyles ApplyTextProps(ITsTextProps props)
		{
			AssembledStyles result = this;
			// Apply writing system, if present, first, so that it can be used to select
			// a named style effect.
			int ttv;
			int ws = props.GetIntPropValues((int) FwTextPropType.ktptWs, out ttv);
			if (ttv != -1)
				result = result.WithWs(ws);
			// Apply named style next, if present, so that style effects can be overridden by explicit ones.
			var namedStyle = props.GetStrPropValue((int) FwTextPropType.ktptNamedStyle);
			if (namedStyle != null)
				result = result.WithNamedStyle(namedStyle);
			int count = props.IntPropCount;
			for (int i = 0; i < count; i++)
			{
				int tpt;
				int val = props.GetIntProp(i, out tpt, out ttv);
				switch (tpt)
				{
					case (int) FwTextPropType.ktptWs: // handled first
						break;
					case (int) FwTextPropType.ktptBold:
						int weight;

						Debug.Assert(ttv == (int) FwTextPropVar.ktpvEnum);
						switch (val)
						{
							case (int) FwTextToggleVal.kttvForceOn:
								weight = (int) VwFontWeight.kvfwBold;
								break;
								// todo JohnT: several others.
							default:
								weight = (int)VwFontWeight.kvfwNormal;
								break;
						}
						result = result.WithFontWeight(weight);
						break;
				}
			}
			return result;
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:57,代码来源:AssembledStyles.cs

示例4: PropsAreEqual

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Compares two TsTextProps
		/// </summary>
		/// <param name="ttp1">expected</param>
		/// <param name="ttp2">actual</param>
		/// <param name="sHowDifferent">Human(geek)-readable string telling how the props are
		/// different, or indicating no difference</param>
		/// <returns>True if they contain the same props, false otherwise</returns>
		/// ------------------------------------------------------------------------------------
		public static bool PropsAreEqual(ITsTextProps ttp1, ITsTextProps ttp2,
			out string sHowDifferent)
		{
			// check how intProps compare
			int cProps1 = ttp1.IntPropCount;
			int cProps2 = ttp2.IntPropCount;
			int tpv1, tpv2; // prop values
			int nVar1, nVar2; // variation info
			int tpt; // prop type
			for (int iprop = 0; iprop < cProps1; iprop++)
			{
				tpv1 = ttp1.GetIntProp(iprop, out tpt, out nVar1);
				tpv2 = ttp2.GetIntPropValues(tpt, out nVar2);

				if (tpv1 != tpv2 || nVar1 != nVar2)
				{
					if (tpt == (int)FwTextPropType.ktptWs)
						sHowDifferent = string.Format("Props differ in ktptWs property. "
							+ "Expected <{0}>, but was <{1}>.", tpv1, tpv2);
					else
						sHowDifferent = string.Format("Props differ in intProp type {0}. "
							+ "Expected <{1},{2}>, but was <{3},{4}>.", tpt, tpv1, nVar1, tpv2, nVar2);
					return false;
				}
			}
			// if count of intProps differs, it will be difficult to report exact difference
			//  so just issue a simple response for now
			if (cProps1 != cProps2)
			{
				sHowDifferent = string.Format("Props differ in count of intProps. "
					+ "Expected <{0}>, but was <{1}>.", cProps1, cProps2);
				return false;
			}

			// check for string properties differences
			int s1count = ttp1.StrPropCount;
			int s2count = ttp2.StrPropCount;
			int strtype;
			string strval1, strval2; // prop values
			for (int iprop = 0; iprop < s1count; iprop++)
			{
				strval1 = ttp1.GetStrProp(iprop, out strtype);
				strval2 = ttp2.GetStrPropValue(strtype);

				if (strval1 != strval2)
				{
					if (strtype == (int)FwTextPropType.ktptNamedStyle)
						sHowDifferent = string.Format("Props differ in ktptNamedStyle property. "
							+ "Expected <{0}>, but was <{1}>.", strval1, strval2);
					else if (strtype == (int)FwTextPropType.ktptObjData)
						sHowDifferent = string.Format("Props differ in ktptObjData property. "
							+ "Expected <{0}>, but was <{1}>.", strval1, strval2);
							// we could detail the objectDataType and Guid if needed
					else
						sHowDifferent = string.Format("Props differ in strProp type {0}. "
							+ "Expected <{1}>, but was <{2}>.", strtype, strval1, strval2);
					return false;
				}
			}
			// if count of strProps differs, it will be difficult to report exact difference
			//  so just issue a simple response for now
			if (s1count != s2count)
			{
				sHowDifferent = string.Format("Props differ in count of strProps. "
					+ "Expected <{0}>, but was <{1}>.", s1count, s2count);
				return false;
			}

			// if we reach this point, no differences were found
			sHowDifferent = "TextProps objects appear to contain the same properties.";
			return true;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:82,代码来源:TsTextPropsHelper.cs

示例5: ExportOrcRun

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Export whatever goes with an ORC (e.g. footnote, picture, etc.)
		/// </summary>
		/// <param name="ttp">Text properties of the run containing the ORC (from which we get
		/// the footnote GUID).</param>
		/// <param name="exportMode">The export mode.</param>
		/// <param name="iWs">index into the available analysis writing systems (should be -1 if
		/// exportMode is ExportMode.VernacularOnly; should  be 0 if exportMode is
		/// ExportMode.BackTransOnly)</param>
		/// <param name="vernFootnotes">If this is a non-interleaved back translation, this is
		/// the list of footnotes in the (vernacular) paragraph being exported.</param>
		/// ------------------------------------------------------------------------------------
		private void ExportOrcRun(ITsTextProps ttp, ExportMode exportMode, int iWs,
			List<IScrFootnote> vernFootnotes)
		{
			Debug.Assert(exportMode != ExportMode.VernacularOnly || iWs == -1);
			Debug.Assert(exportMode != ExportMode.BackTransOnly || iWs == 0);
			string objData = ttp.GetStrPropValue((int)FwTextPropType.ktptObjData);

			if (objData == null)
			{
				// We encountered a bogus ORC. Ignore it.
				return;
			}

			switch (objData[0])
			{
				case (char)FwObjDataTypes.kodtNameGuidHot:
				case (char)FwObjDataTypes.kodtOwnNameGuidHot:
					{
						Guid footnoteGuid = MiscUtils.GetGuidFromObjData(objData.Substring(1));
						IScrFootnote footnote;
						if (m_cache.ServiceLocator.GetInstance<IScrFootnoteRepository>().TryGetFootnote(footnoteGuid, out footnote))
						{
							ExportFootnote(footnote, exportMode, iWs);
							if (vernFootnotes != null)
								vernFootnotes.Remove(footnote);
						}
						break;
					}
				case (char)FwObjDataTypes.kodtGuidMoveableObjDisp:
					{
						Guid pictureGuid = MiscUtils.GetGuidFromObjData(objData.Substring(1));
						ICmPicture picture;
						if (m_cache.ServiceLocator.GetInstance<ICmPictureRepository>().TryGetObject(pictureGuid, out picture))
						{
							// TODO (TE-3619): Need to pass export mode once we can handle putting picture ORCs in back translations.
							ExportPicture(picture);
						}
						break;
					}
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:54,代码来源:ExportUsfm.cs

示例6: XmlTextRun

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="XmlTextRun"/> class, based on the given
		/// run information
		/// </summary>
		/// <param name="wsDefault">The default writing system of the paragraph.</param>
		/// <param name="lgwsf">The writing system factory.</param>
		/// <param name="text">The text of the run.</param>
		/// <param name="props">The properties of the run.</param>
		/// ------------------------------------------------------------------------------------
		public XmlTextRun(int wsDefault, ILgWritingSystemFactory lgwsf, string text,
			ITsTextProps props)
		{
			int dummy;
			int wsRun = props.GetIntPropValues((int)FwTextPropType.ktptWs, out dummy);
			if (wsRun != wsDefault)
				IcuLocale = lgwsf.GetStrFromWs(wsRun);
			StyleName = props.GetStrPropValue((int)FwTextPropType.ktptNamedStyle);
			m_text = text;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:20,代码来源:XmlTextRun.cs

示例7: ExportRefToEmbeddedObject

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Write out a reference to a footnote. A reference should only be exported from a back
		/// translation.
		/// </summary>
		/// <param name="ttp">Properties contain information about the embedded object</param>
		/// ------------------------------------------------------------------------------------
		private void ExportRefToEmbeddedObject(ITsTextProps ttp)
		{
			string objData = ttp.GetStrPropValue((int) FwTextPropType.ktptObjData);
			// if ORC doesn't have properties, continue with next run.
			if (!String.IsNullOrEmpty(objData))
			{
				switch (objData[0])
				{
					case (char) FwObjDataTypes.kodtNameGuidHot:
						IScrFootnote footnote;
						if (!GetReferencedFootnote(ttp, out footnote))
							return; // unable to find referenced footnote

						m_writer.WriteStartElement("note");
						m_writer.WriteAttributeString("noteRef", "f" + m_sCurrentBookId +
							(footnote.IndexInOwner + 1));
						m_writer.WriteEndElement(); // end <note> element
						break;
					default:
						// give warning about dropped pictures in BT, but only give it once.
						if (!m_droppedBtPictureWarningGiven)
						{
							MessageBoxUtils.Show(
								"OXES file format does not support pictures in back translation. Location of pictures in BT will be lost.",
								m_app.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information);
							m_droppedBtPictureWarningGiven = true;
						}
						break;
				}
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:38,代码来源:ExportXml.cs

示例8: InsertDiffParas

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Handle insertion of paragraphs (i.e., from clipboard) with properties that don't
		/// match the properties of the paragraph where they are being inserted. This gives us
		/// the opportunity to create/modify the DB structure to recieve the paragraphs being
		/// inserted and to reject certain types of paste operations (such as attempting to
		/// paste a book).
		/// </summary>
		/// <param name="rootBox">the sender</param>
		/// <param name="ttpDest">properties of destination paragraph</param>
		/// <param name="cPara">number of paragraphs to be inserted</param>
		/// <param name="ttpSrcArray">Array of props of each para to be inserted</param>
		/// <param name="tssParas">Array of TsStrings for each para to be inserted</param>
		/// <param name="tssTrailing">Text of an incomplete paragraph to insert at end (with
		/// the properties of the destination paragraph.</param>
		/// <returns>One of the following:
		/// kidprDefault - causes the base implementation to insert the material as part of the
		/// current StText in the usual way;
		/// kidprFail - indicates that we have decided that this text should not be pasted at
		/// this location at all, causing entire operation to roll back;
		/// kidprDone - indicates that we have handled the paste ourselves, inserting the data
		/// whereever it ought to go and creating any necessary new structure.</returns>
		/// ------------------------------------------------------------------------------------
		public VwInsertDiffParaResponse InsertDiffParas(IVwRootBox rootBox,
			ITsTextProps ttpDest, int cPara, ITsTextProps[] ttpSrcArray, ITsString[] tssParas,
			ITsString tssTrailing)
		{
			CheckDisposed();

			Debug.Assert(!IsBackTranslation);

			if (cPara != ttpSrcArray.Length || cPara != tssParas.Length || ttpDest == null ||
				IsBackTranslation)
				return VwInsertDiffParaResponse.kidprFail;

			// Get the context of the style we are inserting into
			string destStyleName =
				ttpDest.GetStrPropValue((int)FwTextStringProp.kstpNamedStyle);
			IStStyle destStyle = null;
			if (destStyleName != null)
				destStyle = m_scr.FindStyle(destStyleName);
			if (destStyle == null)
				return VwInsertDiffParaResponse.kidprFail;
			ContextValues destContext = destStyle.Context;
			StructureValues destStructure = destStyle.Structure;

			// If pasted data came from a non-FW app, all elements in the source props array
			// will be null. In this case, the default behavior will work fine.
			if (ttpSrcArray[0] == null)
			{
				int i;
				for (i = 1; i < ttpSrcArray.Length; i++)
				{
					if (ttpSrcArray[i] != null)
						break;
				}
				if (i >= ttpSrcArray.Length)
					return VwInsertDiffParaResponse.kidprDefault;
			}

			// Look through the source data (being inserted) to see if there is a conflict.
			ContextValues srcContext;
			StructureValues srcStructure;
			if (!GetSourceContextAndStructure(ttpSrcArray, out srcContext, out srcStructure))
			{
				MiscUtils.ErrorBeep();
				return VwInsertDiffParaResponse.kidprFail;
			}

			// If context of the style is Title then throw out the entire insert.
			// REVIEW: Should this allow insertion of a title para within an existing title?
			if (srcContext == ContextValues.Title)
			{
				MiscUtils.ErrorBeep();
				return VwInsertDiffParaResponse.kidprFail;
			}

			// Set a flag if the src context/structure is different from the dest context/structure
			bool foundMismatch = (srcContext != destContext) || (srcStructure != destStructure);

			if (!foundMismatch)
				// let the views handle it!
				return VwInsertDiffParaResponse.kidprDefault;

			bool noTrailingText =
				(tssTrailing == null || tssTrailing.Length == 0);

			// If insertion point is at beginning of paragraph and there is no trailing text
			if (CurrentSelection.IchAnchor == 0 && noTrailingText)
			{
				if (InBookTitle)
				{
					if (InsertParagraphsBeforeBook(ttpSrcArray, tssParas, srcContext))
						return VwInsertDiffParaResponse.kidprDone;
				}
				else if (InSectionHead)
				{
					if (SectionIndex > 0 && ParagraphIndex == 0 &&
						InsertParagraphsBeforeSection(ttpSrcArray, tssParas, srcContext))
						return VwInsertDiffParaResponse.kidprDone;
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:WorldPad,代码行数:101,代码来源:TeEditingHelper.cs

示例9: IsStyle

		public const string DefaultMonospace = "<default monospace>";	// CANNOT BE LOCALIZED AS PUBLIC CONST STRING.
		#endregion

		#region Public methods
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Check the given text props to see if they specify the given style
		/// </summary>
		/// <param name="ttp">Text props</param>
		/// <param name="sStyle">Style</param>
		/// <returns>true if the given text props use the given named style</returns>
		/// ------------------------------------------------------------------------------------
		public static bool IsStyle(ITsTextProps ttp, string sStyle)
		{
			return (ttp.GetStrPropValue(
				(int)FwTextPropType.ktptNamedStyle) == sStyle);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:17,代码来源:StStyle.cs

示例10: ExportEmbeddedObject

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// If the embedded object is a footnote or picture, write it out.
		/// </summary>
		/// <param name="ttp">Properties contain information about the embedded object</param>
		/// ------------------------------------------------------------------------------------
		private void ExportEmbeddedObject(ITsTextProps ttp)
		{
			string objData = ttp.GetStrPropValue((int)FwTextPropType.ktptObjData);
			// if ORC doesn't have properties, continue with next run.
			if (!String.IsNullOrEmpty(objData))
			{
				switch (objData[0])
				{
					case (char)FwObjDataTypes.kodtOwnNameGuidHot:
					case (char)FwObjDataTypes.kodtNameGuidHot:
						Guid footnoteGuid = MiscUtils.GetGuidFromObjData(objData.Substring(1));
						IScrFootnote footnote;
						if (m_cache.ServiceLocator.GetInstance<IScrFootnoteRepository>().TryGetFootnote(footnoteGuid, out footnote))
						{
							ExportFootnote(footnote);
						}
						break;
					case (char)FwObjDataTypes.kodtGuidMoveableObjDisp:
						Guid pictureGuid = MiscUtils.GetGuidFromObjData(objData.Substring(1));
						ICmPicture picture;
						if (m_cache.ServiceLocator.GetInstance<ICmPictureRepository>().TryGetObject(pictureGuid, out picture))
							ExportPicture(picture);
						break;
					case (char)FwObjDataTypes.kodtPictEvenHot:
						m_writer.WriteComment("object type PictEven not handled");
						break;
					case (char)FwObjDataTypes.kodtPictOddHot:
						m_writer.WriteComment("object type PictOdd not handled");
						break;
					case (char)FwObjDataTypes.kodtExternalPathName:
						m_writer.WriteComment("object type ExternalPathName not handled");
						break;
					case (char)FwObjDataTypes.kodtEmbeddedObjectData:
						m_writer.WriteComment("object type EmbeddedObjectData not handled");
						break;
					case (char)FwObjDataTypes.kodtContextString:
						m_writer.WriteComment("object type ContextString not handled");
						break;
					default:
						m_writer.WriteComment(
							String.Format("unknown object type ({0}) not handled", (int)objData[0]));
						break;
				}
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:51,代码来源:ExportXml.cs

示例11: IsHyperlink

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Checks to see if the text properties are for a hyperlink.
		/// </summary>
		/// <param name="ttp">The text properties.</param>
		/// <returns><c>true</c> if the properties are for a hyperlink; <c>false</c> otherwise.
		/// </returns>
		/// ------------------------------------------------------------------------------------
		public static bool IsHyperlink(ITsTextProps ttp)
		{
			string objData = ttp.GetStrPropValue((int)FwTextPropType.ktptObjData);
			if (!String.IsNullOrEmpty(objData) && objData.Length > 1 &&
				objData[0] == Convert.ToChar((int)FwObjDataTypes.kodtExternalPathName))
			{
				return true;
			}
			return false;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:18,代码来源:StringUtils.cs

示例12: GetGuidFromRun

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Get a Guid from the given run in a structured text string.
		/// </summary>
		/// <param name="tss">given structured text string</param>
		/// <param name="iRun">given run</param>
		/// <param name="odt">object data type, 0 if no ORC guid located</param>
		/// <param name="tri">run information</param>
		/// <param name="ttp">text properties of the run (if incoming value is  null and the
		/// run is an object, this will be set to the run props)</param>
		/// <param name="desiredOrcTypes">The desired ORC types, or null to return any type of
		/// ORC</param>
		/// <returns>
		/// The GUID associated with the specified run of the tss, if any; otherwise Guid.Empty
		/// </returns>
		/// ------------------------------------------------------------------------------------
		private static Guid GetGuidFromRun(ITsString tss, int iRun,
			Set<FwObjDataTypes> desiredOrcTypes, out FwObjDataTypes odt, out TsRunInfo tri,
			ref ITsTextProps ttp)
		{
			odt = 0;
			tss.FetchRunInfo(iRun, out tri);
			if (tri.ichLim - tri.ichMin == 1 &&
				tss.get_RunText(iRun)[0] == kchObject)
			{
				// determine if single-character run contains an ORC
				ttp = ttp ?? tss.get_Properties(iRun);
				string sObjData = ttp.GetStrPropValue(
					(int)FwTextPropType.ktptObjData);

				if (sObjData != null)
				{
					odt = (FwObjDataTypes)Convert.ToByte(sObjData[0]);
					// See if it's one of the types of objects we want.
					if (desiredOrcTypes == null || desiredOrcTypes.Contains(odt))
					{
						// Get GUID for ORC
						return MiscUtils.GetGuidFromObjData(sObjData.Substring(1));
					}
				}
			}
			return Guid.Empty;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:43,代码来源:StringUtils.cs

示例13: ExportEmbeddedObject

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// If the embedded object is a footnote or picture, write it out.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private void ExportEmbeddedObject(ITsTextProps ttp)
		{
			string objData = ttp.GetStrPropValue((int)FwTextPropType.ktptObjData);
			// if ORC doesn't have properties, continue with next run.
			if (!String.IsNullOrEmpty(objData))
			{
				switch (objData[0])
				{
					case (char)FwObjDataTypes.kodtOwnNameGuidHot:
					case (char)FwObjDataTypes.kodtNameGuidHot:
						Guid footnoteGuid = MiscUtils.GetGuidFromObjData(objData.Substring(1));
						int hvoFootnote = m_cache.GetIdFromGuid(footnoteGuid);
						if (hvoFootnote != 0)
							ExportFootnote(new ScrFootnote(m_cache, hvoFootnote));
						break;
					case (char)FwObjDataTypes.kodtGuidMoveableObjDisp:
						Guid pictureGuid = MiscUtils.GetGuidFromObjData(objData.Substring(1));
						int hvoPicture = m_cache.GetIdFromGuid(pictureGuid);
						if (hvoPicture != 0)
							ExportPicture(new CmPicture(m_cache, hvoPicture));
						break;
					case (char)FwObjDataTypes.kodtPictEven:
						m_writer.WriteComment("object type PictEven not handled");
						break;
					case (char)FwObjDataTypes.kodtPictOdd:
						m_writer.WriteComment("object type PictOdd not handled");
						break;
					case (char)FwObjDataTypes.kodtExternalPathName:
						m_writer.WriteComment("object type ExternalPathName not handled");
						break;
					case (char)FwObjDataTypes.kodtEmbeddedObjectData:
						m_writer.WriteComment("object type EmbeddedObjectData not handled");
						break;
					case (char)FwObjDataTypes.kodtContextString:
						m_writer.WriteComment("object type ContextString not handled");
						break;
					default:
						m_writer.WriteComment(
							String.Format("unknown object type ({0}) not handled", (int)objData[0]));
						break;
				}
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:48,代码来源:ExportXml.cs

示例14: spyOnTextProps

		private void spyOnTextProps(ITsTextProps ttp)
		{
			int tpt; // ??

			// look at integer props
			int cintProps = ttp.IntPropCount;
			for (int i = 0; i < cintProps; i++)
			{
				int nVar;
				int intProp = ttp.GetIntProp(i, out tpt, out nVar);
				int Value = ttp.GetIntPropValues(tpt, out nVar);
				Value = 34; // need something so Value can be looked at
			}

			// look at string props
			int cstrProps = ttp.StrPropCount;
			for (int i = 0; i < cstrProps; i++)
			{
				string strProp = ttp.GetStrProp(i, out tpt);
				string Value = ttp.GetStrPropValue(tpt);
				Value = "why?"; // need something so Value can be looked at
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:23,代码来源:SelectText.cs

示例15: GetFootnoteGuidIfAny

//#if DEBUG
//        private void WriteSegmentedBackTransDebugInfo(BTSegment bts, int iseg)
//        {
//            foreach (int ws1 in bts.AvailableTranslations)
//            {
//                ITsString tssBT = bts.GetTransForWs(ws1);
//                string sBTDebug = String.Format("Seg[{0}] begin={1,4}, end={2,4}; [{3}]='{4}'",
//                    iseg, bts.BeginOffset, bts.EndOffset,
//                    m_cache.LanguageWritingSystemFactoryAccessor.GetStrFromWs(ws1),
//                    tssBT == null ? "<NULL>" : tssBT.Text);
//                Debug.WriteLine(sBTDebug);
//            }
//        }
//#endif

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// If the text props contains a footnote pointer, return the Guid which refers to the
		/// footnote.  Otherwise, return Guid.Empty.
		/// </summary>
		/// <param name="props"></param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		private static Guid GetFootnoteGuidIfAny(ITsTextProps props)
		{
			string objData = props.GetStrPropValue((int)FwTextPropType.ktptObjData);
			if (!String.IsNullOrEmpty(objData) &&
				(objData[0] == (char)FwObjDataTypes.kodtOwnNameGuidHot ||
				objData[0] == (char)FwObjDataTypes.kodtNameGuidHot))
			{
				return MiscUtils.GetGuidFromObjData(objData.Substring(1));
			}
			return Guid.Empty;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:34,代码来源:ExportXml.cs


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