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


C# IVwEnv.OpenMappedTaggedPara方法代码示例

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


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

示例1: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Displays the specified vwenv.
		/// </summary>
		/// <param name="vwenv">The vwenv.</param>
		/// <param name="hvo">The hvo.</param>
		/// <param name="frag">The frag.</param>
		/// ------------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			CheckDisposed();

			switch(frag)
			{
				case kfragLazyScripture:
				{
					// The configure method insists on trying to make an initial selection.
					// If there isn't something selectable there, it expands everything.
					vwenv.AddStringProp((int)Scripture.ScriptureTags.kflidChapterVerseSepr, this);
					vwenv.AddLazyVecItems((int)Scripture.ScriptureTags.kflidScriptureBooks, this,
						kfragLazyBook);
					break;
				}
				case kfragLazyBook:
				{
					vwenv.AddLazyVecItems((int)ScrBook.ScrBookTags.kflidSections, this,
						kfragDummySection);
					break;
				}
				case kfragDummySection:
				{
					vwenv.AddObjProp((int)ScrSection.ScrSectionTags.kflidHeading, this,
						kfragDummyStText);
					vwenv.AddObjProp((int)ScrSection.ScrSectionTags.kflidContent, this,
						kfragDummyStText);
					break;
				}
				case kfragDummyStText:
				{
					vwenv.AddObjVecItems((int)StText.StTextTags.kflidParagraphs, this,
						m_fParaWithContent ? kfragDummyParaWithContent : kfragDummyPara);
					break;
				}
				case kfragDummyPara:
				{
					// Display each dummy paragraph as a rectangle an inch high, which allows us
					// to accurately predict the height of a known number of them.
					vwenv.AddSimpleRect(0, MiscUtils.kdzmpInch, MiscUtils.kdzmpInch, 0);
					break;
				}
				case kfragDummyParaWithContent:
				{
					vwenv.OpenMappedTaggedPara();
					vwenv.AddStringProp((int)StTxtPara.StTxtParaTags.kflidContents, null);
					vwenv.CloseParagraph();
					break;
				}
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:59,代码来源:LazyPrintLayoutTests.cs

示例2: Display


//.........这里部分代码省略.........
						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.kTitle) == DisplayType.kTitle)
						vwenv.AddObjProp(SimpleRootsiteTestsConstants.kflidDocTitle, 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(SimpleRootsiteTestsConstants.kflidTextParas, this, 4);
					vwenv.AddLazyVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this, 5);
					break;
				case 3: // An StText, display paragraphs not lazily.
					if ((m_displayType & DisplayType.kWithTopMargin) == DisplayType.kWithTopMargin)
						vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this, 4);
					vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this, 5);
					if ((m_displayType & DisplayType.kDuplicateParagraphs) != 0)
						vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this, 5);
					break;
				case 4: // StTxtPara, display contents with top margin
					OpenParaIfNeeded(vwenv, hvo);
					vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTop,
						(int)FwTextPropVar.ktpvMilliPoint, kMarginTop);
					AddParagraphContents(vwenv);
					break;
				case 5: // StTxtPara, display contents without top margin
					OpenParaIfNeeded(vwenv, hvo);
					AddParagraphContents(vwenv);
					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 SimpleRootsiteTestsConstants.kflidDocDivisions:
					vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidDocDivisions, this,
						SimpleRootsiteTestsConstants.kflidSectionStuff);
					break;
				case SimpleRootsiteTestsConstants.kflidSectionStuff:
					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(SimpleRootsiteTestsConstants.kflidDocFootnotes, this, 8);
					vwenv.CloseDiv();
					break;
				case 8: // StFootnote
					vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this,
						9);
					break;
				case 9: // StTxtPara
					vwenv.AddStringProp(SimpleRootsiteTestsConstants.kflidParaContents, null);
					break;
				case 10:
					// Display a Footnote by displaying its "FootnoteMarker" in a paragraph
					// by itself, followed by the sequence of paragraphs.
					vwenv.AddStringProp(SimpleRootsiteTestsConstants.kflidFootnoteMarker, null);
					vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this,
						9);
					break;
				case 11:
					// Display a Footnote by displaying its "FootnoteMarker" followed by the
					// contents of its first paragraph (similar to the way footnotes are displayed in
					// real life.
					vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this, 12);
					break;
				case 12: // Footnote paragraph with marker
					vwenv.OpenMappedTaggedPara();
					// The footnote marker is not editable.
					vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
						(int)FwTextPropVar.ktpvEnum,
						(int)TptEditable.ktptNotEditable);
					vwenv.AddStringProp(SimpleRootsiteTestsConstants.kflidFootnoteMarker, null);

					// add a read-only space after the footnote marker
					vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
						(int)FwTextPropVar.ktpvEnum,
						(int)TptEditable.ktptNotEditable);
					ITsIncStrBldr strBldr = TsIncStrBldrClass.Create();
					strBldr.Append(" ");
					vwenv.AddString(strBldr.GetString());
					vwenv.AddStringProp(SimpleRootsiteTestsConstants.kflidParaContents, null);
					vwenv.CloseParagraph();
					break;
				default:
					throw new ApplicationException("Unexpected frag in DummyBasicViewVc");
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:101,代码来源:SimpleViewVc.cs

示例3: CreateNotesParagraph

		private void CreateNotesParagraph(IVwEnv vwenv, List<int> notes, ITsTextProps styleProps)
		{
			// Don't create a completely empty paragraph. The way the Views system handles such paragraphs
			// doesn't work for a MappedTaggedPara. Also, we want the footnote to take up no height at all
			// if there are none.
			if (notes.Count == 0)
				return;
			vwenv.set_IntProperty((int)FwTextPropType.ktptBaseWs,
				(int)FwTextPropVar.ktpvDefault, DefaultWs);
			vwenv.set_IntProperty((int)FwTextPropType.ktptRightToLeft,
				(int)FwTextPropVar.ktpvEnum, (RightToLeft ? -1 : 0));
			vwenv.set_IntProperty((int)FwTextPropType.ktptAlign,
				(int)FwTextPropVar.ktpvEnum,
				RightToLeft ? (int)FwTextAlign.ktalRight : (int)FwTextAlign.ktalLeft);
			vwenv.Props = styleProps;

			// The body of the paragraph is either editable or not.
			vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
				(int)FwTextPropVar.ktpvEnum,
				Editable ? (int)TptEditable.ktptIsEditable
				: (int)TptEditable.ktptNotEditable);

			vwenv.OpenMappedTaggedPara();
			for (int ihvo = 0; ihvo < notes.Count; ihvo++)
			{
				// Optimize JohnT: could make this string once and save it in a member variable.
				if (ihvo != 0)
					vwenv.AddString(m_cache.MakeVernTss("  "));
				vwenv.AddObj(notes[ihvo], this, (int)FootnoteFrags.kfrFootnoteWithinPagePara);
			}
			vwenv.CloseParagraph();
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:32,代码来源:FootnoteVc.cs

示例4: OpenPara

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Call the appropriate "OpenPara" method.  This function is virtual to allow
		/// an override to create a different type of paragraph.
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="hvoPara">the StTxtPara for which we want a paragraph</param>
		/// ------------------------------------------------------------------------------------
		protected virtual void OpenPara(IVwEnv vwenv, int hvoPara)
		{
			vwenv.OpenMappedTaggedPara();
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:12,代码来源:StVc.cs


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