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


C# IVwEnv.OpenMappedPara方法代码示例

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


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

示例1: AddFreeformComment

		protected virtual void AddFreeformComment(IVwEnv vwenv, int hvoSeg, int lineChoiceIndex)
		{
			int[] wssAnalysis = m_lineChoices.AdjacentWssAtIndex(lineChoiceIndex);
			if (wssAnalysis.Length == 0)
				return;
			vwenv.OpenDiv();
			SetParaDirectionAndAlignment(vwenv, wssAnalysis[0]);
			vwenv.OpenMappedPara();
			string label;
			int flid;
			InterlinearExporter exporter = vwenv as InterlinearExporter;
			int dummyFlid = m_lineChoices[lineChoiceIndex].Flid;
			switch (dummyFlid)
			{
				case InterlinLineChoices.kflidFreeTrans:
					label = ITextStrings.ksFree_;
					flid = SegmentTags.kflidFreeTranslation;
					if (exporter != null)
						exporter.FreeAnnotationType = "gls";
					break;
				case InterlinLineChoices.kflidLitTrans:
					label = ITextStrings.ksLit_;
					flid = SegmentTags.kflidLiteralTranslation;
					if (exporter != null)
						exporter.FreeAnnotationType = "lit";
					break;
				case InterlinLineChoices.kflidNote:
					label = ITextStrings.ksNote_;
					flid = NoteTags.kflidContent;
					if (exporter != null)
						exporter.FreeAnnotationType = "note";
					break;
				default:
					throw new Exception("Unexpected FF annotation type");
			}
			SetNoteLabelProps(vwenv);
			// REVIEW: Should we set the label to a special color as well?
			ITsString tssLabel = MakeUiElementString(label, m_cache.DefaultUserWs,
				propsBldr => propsBldr.SetIntPropValues((int)FwTextPropType.ktptBold,
				(int)FwTextPropVar.ktpvEnum, (int)FwTextToggleVal.kttvForceOn));
			ITsStrBldr labelBldr = tssLabel.GetBldr();
			AddLineIndexProperty(labelBldr, lineChoiceIndex);
			tssLabel = labelBldr.GetString();
			int labelWidth = 0;
			int labelHeight; // unused
			if (wssAnalysis.Length > 1)
				vwenv.get_StringWidth(tssLabel, null, out labelWidth, out labelHeight);
			if (IsWsRtl(wssAnalysis[0]) != m_fRtl)
			{
				ITsStrBldr bldr = tssLabel.GetBldr();
				bldr.Replace(bldr.Length - 1, bldr.Length, null, null);
				ITsString tssLabelNoSpace = bldr.GetString();
				// (First) analysis language is upstream; insert label at end.
				vwenv.AddString(GetTssDirForWs(wssAnalysis[0]));
				AddFreeformComment(vwenv, hvoSeg, wssAnalysis[0], flid);
				vwenv.AddString(GetTssDirForWs(wssAnalysis[0]));
				if (wssAnalysis.Length != 1)
				{
					// Insert WS label for first line
					vwenv.AddString(m_tssDir);
					vwenv.AddString(m_tssSpace);
					vwenv.AddString(m_tssDir);
					SetNoteLabelProps(vwenv);
					vwenv.AddString(WsListManager.WsLabel(m_cache, wssAnalysis[0]));
				}
				vwenv.AddString(m_tssDir);
				vwenv.AddString(m_tssSpace);
				vwenv.AddString(m_tssDir);
				vwenv.AddString(tssLabelNoSpace);
				vwenv.AddString(m_tssDir);
			}
			else
			{
				vwenv.AddString(m_tssDir);
				vwenv.AddString(tssLabel);
				vwenv.AddString(m_tssDir);
				if (wssAnalysis.Length == 1)
				{
					vwenv.AddString(GetTssDirForWs(wssAnalysis[0]));
					AddFreeformComment(vwenv, hvoSeg, wssAnalysis[0], flid);
				}
				else
				{
					SetNoteLabelProps(vwenv);
					vwenv.AddString(WsListManager.WsLabel(m_cache, wssAnalysis[0]));
					vwenv.AddString(m_tssDir);
					vwenv.AddString(m_tssSpace);
					// label width unfortunately does not include trailing space.
					vwenv.AddString(m_tssDir);
					vwenv.AddString(GetTssDirForWs(wssAnalysis[0]));
					AddFreeformComment(vwenv, hvoSeg, wssAnalysis[0], flid);
				}
			}
			// Add any other lines, each in its appropriate direction.
			for (int i = 1; i < wssAnalysis.Length; i++)
			{
				vwenv.CloseParagraph();
				// Indent subsequent paragraphs by the width of the main label.
				if (IsWsRtl(wssAnalysis[i]) != m_fRtl)
				{
//.........这里部分代码省略.........
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:101,代码来源:InterlinVc.cs

示例2: OpenParaIfNeeded

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Conditionally open a mapped paragraph (depending on the requested display type).
		/// Also, if requested, apply the paragraph properties of the given paragraph
		/// </summary>
		/// <param name="vwenv">The view environment</param>
		/// <param name="hvo">HVO of the paragraph</param>
		/// ------------------------------------------------------------------------------------
		private void OpenParaIfNeeded(IVwEnv vwenv, int hvo)
		{
			if ((m_displayType & DisplayType.kMappedPara) == DisplayType.kMappedPara)
			{
				if ((m_displayType & DisplayType.kUseParaProperties) == DisplayType.kUseParaProperties)
					vwenv.Props = (ITsTextProps) vwenv.DataAccess.get_UnknownProp(hvo, SimpleRootsiteTestsConstants.kflidParaProperties);
				vwenv.OpenMappedPara();
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:17,代码来源:SimpleViewVc.cs

示例3: AddColumn

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Add a column to the header/footer
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="align"></param>
		/// <param name="flid"></param>
		/// ------------------------------------------------------------------------------------
		private void AddColumn(IVwEnv vwenv, FwTextAlign align, PubHeader.PubHeaderTags flid)
		{
			vwenv.OpenTableCell(1, 1);
			if (HeaderFooterParaStyle != null && HeaderFooterParaStyle != string.Empty)
			{
				vwenv.set_StringProperty((int)FwTextPropType.ktptNamedStyle,
					HeaderFooterParaStyle);
			}
			vwenv.set_IntProperty((int)FwTextPropType.ktptAlign,
				(int)FwTextPropVar.ktpvEnum, (int)align);
			vwenv.OpenMappedPara();
			vwenv.AddStringProp((int)flid, this);
			vwenv.CloseParagraph();
			vwenv.CloseTableCell();
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:23,代码来源:HeaderFooterVc.cs

示例4: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		///
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		/// <param name="frag"></param>
		/// ------------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			if ((m_displayType & DisplayType.kLiteralStringLabels) != 0)
			{
				ITsStrFactory factory = TsStrFactoryClass.Create();
				vwenv.AddString(factory.MakeString("Label" + m_counter++, m_wsDefault));
			}
			switch(frag)
			{
				case 1: // the root; display the subitems, first using non-lazy view, then lazy one.
					if ((m_displayType & DisplayType.kBookFootnoteDetailsSeparateParas) == DisplayType.kBookFootnoteDetailsSeparateParas)
						vwenv.AddObjVecItems(m_flid, this, 10);
					if ((m_displayType & DisplayType.kBookFootnoteDetailsSinglePara) == DisplayType.kBookFootnoteDetailsSinglePara)
						vwenv.AddObjVecItems(m_flid, this, 11);
					else
					{
						if ((m_displayType & DisplayType.kNormal) == DisplayType.kNormal)
						{
							vwenv.AddObjVecItems(m_flid, this, 3);
						}
						if ((m_displayType & DisplayType.kLazy) == DisplayType.kLazy)
						{
							vwenv.AddObjVecItems(m_flid, this, 2);
						}
					}
					if ((m_displayType & DisplayType.kBookTitle) == DisplayType.kBookTitle)
						vwenv.AddObjProp(ScrBookTags.kflidTitle, this, 3);
					if (m_displayType == DisplayType.kOuterObjDetails)
						vwenv.AddObjVecItems(m_flid, this, 6);
					break;
				case 2: // An StText, display paragraphs lazily
					if ((m_displayType & DisplayType.kWithTopMargin) == DisplayType.kWithTopMargin)
						vwenv.AddLazyVecItems(StTextTags.kflidParagraphs, this, 4);
					vwenv.AddLazyVecItems(StTextTags.kflidParagraphs, this, 5);
					break;
				case 3: // An StText, display paragraphs not lazily.
					if ((m_displayType & DisplayType.kWithTopMargin) == DisplayType.kWithTopMargin)
						vwenv.AddObjVecItems(StTextTags.kflidParagraphs, this, 4);
					vwenv.AddObjVecItems(StTextTags.kflidParagraphs, this, 5);
					if ((m_displayType & DisplayType.kDuplicateParagraphs) != 0)
						vwenv.AddObjVecItems(StTextTags.kflidParagraphs, this, 5);
					break;
				case 4: // StTxtPara, display contents with top margin
					if ((m_displayType & DisplayType.kMappedPara) == DisplayType.kMappedPara)
						vwenv.OpenMappedPara();
					vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTop,
						(int)FwTextPropVar.ktpvMilliPoint, kMarginTop);
					vwenv.AddStringProp(StTxtParaTags.kflidContents, null);
					vwenv.AddStringProp(StTxtParaTags.kflidContents, null);
					vwenv.AddStringProp(StTxtParaTags.kflidContents, null);
					if ((m_displayType & DisplayType.kMappedPara) == DisplayType.kMappedPara)
						vwenv.CloseParagraph();
					break;
				case 5: // StTxtPara, display contents without top margin
					//vwenv.set_IntProperty((int)FwTextPropType.ktptFontSize,
					//    (int)FwTextPropVar.ktpvMilliPoint, 15000);
					if ((m_displayType & DisplayType.kMappedPara) == DisplayType.kMappedPara)
						vwenv.OpenMappedPara();
					vwenv.AddStringProp(StTxtParaTags.kflidContents, null);
					vwenv.AddStringProp(StTxtParaTags.kflidContents, null);
					vwenv.AddStringProp(StTxtParaTags.kflidContents, null);
					if ((m_displayType & DisplayType.kMappedPara) == DisplayType.kMappedPara)
						vwenv.CloseParagraph();
					break;
				case 6: // StTxtPara, display details of our outer object
					int hvoOuter, tag, ihvo;
					vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoOuter, out tag, out ihvo);
					ITsString tss = TsStringHelper.MakeTSS("Hvo = " + hvoOuter + "; Tag = " + tag + "; Ihvo = " + ihvo,
						m_wsDefault);
					vwenv.AddString(tss);
					break;
				case ScrBookTags.kflidSections:
					vwenv.AddObjVecItems(ScrBookTags.kflidSections, this,
						ScrSectionTags.kflidContent);
					break;
				case ScrSectionTags.kflidHeading:
				case ScrSectionTags.kflidContent:
					if ((m_displayType & DisplayType.kNormal) == DisplayType.kNormal)
						vwenv.AddObjProp(frag, this, 3);
					if ((m_displayType & DisplayType.kLazy) == DisplayType.kLazy)
						vwenv.AddObjProp(frag, this, 2);
					break;
				case 7: // ScrBook
					vwenv.OpenDiv();
					vwenv.AddObjVecItems(ScrBookTags.kflidFootnotes, this, 8);
					vwenv.CloseDiv();
					break;
				case 8: // StFootnote
					vwenv.AddObjVecItems(StTextTags.kflidParagraphs, this,
						9);
					break;
				case 9: // StTxtPara
//.........这里部分代码省略.........
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:101,代码来源:DummyBasicViewVc.cs


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