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


C# IVwEnv.AddLazyVecItems方法代码示例

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


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

示例1: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This is the main interesting method of displaying objects and fragments of them.
		/// A Scripture is displayed by displaying its Books;
		/// and a Book is displayed by displaying its Title and Sections;
		/// and a Section is diplayed by displaying its Heading and Content;
		/// which are displayed by using the standard view constructor for StText.
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		/// <param name="frag"></param>
		/// ------------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			CheckDisposed();

			if (hvo == 0)
				return; // not much we can display without a valid object

			switch (frag)
			{
				case (int)ScrFrags.kfrBook:
					vwenv.OpenDiv();
					vwenv.AddObjProp((int)ScrBook.ScrBookTags.kflidTitle, this,
						(int)StTextFrags.kfrText);
					vwenv.NoteDependency(new int[] { m_cache.LangProject.TranslatedScriptureOAHvo },
						new int[] { (int)Scripture.ScriptureTags.kflidScriptureBooks }, 1);
					vwenv.NoteDependency(new int[] { hvo },
						new int[] { (int)ScrBook.ScrBookTags.kflidSections }, 1);
					vwenv.AddLazyVecItems(m_sectionTag, this, (int)ScrFrags.kfrSection);

					// TODO (EberhardB): The gap between the intro division and the text
					// division probably needs to be configurable somewhere...
					// Add a 24 point gap at the bottom of the intro section
					vwenv.AddSimpleRect(ColorUtil.ConvertColorToBGR(BackColor), -1, 24000, 0);
					vwenv.CloseDiv();
					break;
				default:
					base.Display(vwenv, hvo, frag);
					break;
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:42,代码来源:ScriptureBookIntroVc.cs

示例2: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This is the main interesting method of displaying objects and fragments of them.
		/// A Scripture is displayed by displaying its Books;
		/// and a Book is displayed by displaying its Title and Sections;
		/// and a Section is diplayed by displaying its Heading and Content;
		/// which are displayed by using the standard view constructor for StText.
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		/// <param name="frag"></param>
		/// ------------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			CheckDisposed();

			if (hvo == 0)
				return; // not much we can display without a valid object

			switch (frag)
			{
				case (int)ScrFrags.kfrBook:
					vwenv.OpenDiv();
					vwenv.NoteDependency(new int[] { m_cache.LanguageProject.TranslatedScriptureOA.Hvo },
						new int[] { ScriptureTags.kflidScriptureBooks }, 1);
					vwenv.NoteDependency(new int[] { hvo },
						new int[] { ScrBookTags.kflidSections }, 1);
					vwenv.AddLazyVecItems(ScrBookTags.kflidSections, this, (int)ScrFrags.kfrSection);
					vwenv.CloseDiv();
					break;
				default:
					base.Display(vwenv, hvo, frag);
					break;
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:35,代码来源:ScriptureBodyVc.cs

示例3: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This is the main interesting method of displaying objects and fragments of them.
		/// A Scripture is displayed by displaying its Books;
		/// and a Book is displayed by displaying its Title and Sections;
		/// and a Section is diplayed by displaying its Heading and Content;
		/// which are displayed by using the standard view constructor for StText.
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		/// <param name="frag"></param>
		/// ------------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			CheckDisposed();

			switch(frag)
			{
				case (int)FootnoteFrags.kfrScripture:
				case (int)ScrFrags.kfrScripture:
				{
					vwenv.NoteDependency(new[] { hvo }, new[] { ScrBookTags.kflidFootnotes }, 1);

					// This fragment should only be used on full refresh - clear the user prompt
					// flags so they will be shown again.
					ClearUserPromptUpdates();

					// We add this lazy - we will expand some of it immediately, but the non-
					// visible parts will remain lazy!
					vwenv.NoteDependency(new[]{m_cache.LanguageProject.TranslatedScriptureOA.Hvo},
						new[]{ScriptureTags.kflidScriptureBooks}, 1);
					vwenv.AddLazyVecItems(BooksTag, this,
						frag == (int)ScrFrags.kfrScripture ? (int)ScrFrags.kfrBook : (int)FootnoteFrags.kfrBook);

					// Add a 48 point gap at the bottom of the view
					if (!PrintLayout && (frag != (int)FootnoteFrags.kfrScripture))
						vwenv.AddSimpleRect((int)ColorUtil.ConvertColorToBGR(BackColor), -1, 48000, 0);
					break;
				}
				case (int)ScrFrags.kfrBook:
				{
					vwenv.OpenDiv();
					vwenv.AddObjProp(ScrBookTags.kflidTitle, this, (int)StTextFrags.kfrText);
					vwenv.AddLazyVecItems(ScrBookTags.kflidSections, this, (int)ScrFrags.kfrSection);

					// Add a 48 point gap at the bottom of the view
					if (!PrintLayout && m_fShowTailingSpace)
						vwenv.AddSimpleRect((int)ColorUtil.ConvertColorToBGR(BackColor), -1, 48000, 0);

					if (!PrintLayout)
						InsertBookSeparator(hvo, vwenv);
					vwenv.CloseDiv();
					break;
				}
				case (int)ScrFrags.kfrSection:
				{
					vwenv.OpenDiv();
					vwenv.AddObjProp(ScrSectionTags.kflidHeading, this, (int)StTextFrags.kfrText);
					vwenv.AddObjProp(ScrSectionTags.kflidContent, this, (int)StTextFrags.kfrText);
					vwenv.CloseDiv();
					break;
				}
				case (int)StTextFrags.kfrPara:
					if (PrintLayout || !m_fDisplayInTable)
					{
						// We are displaying Scripture or a print layout view
						base.Display(vwenv, hvo, frag);
					}
					else
					{
						// We are displaying a back translation or Scripture in draftview in a table
						// Open a table to display the BT para in column 1, and the icon in column 2.
						VwLength vlTable; // we use this to specify that the table takes 100% of the width.
						vlTable.nVal = 10000;
						vlTable.unit = VwUnit.kunPercent100;

						VwLength vlColumn; // and this one to specify 90% for the text
						vlColumn.nVal = DisplayTranslation ? 9000 : 10000;
						vlColumn.unit = VwUnit.kunPercent100;

						int nColumns = DisplayTranslation ? 2 : 1;

						vwenv.OpenTable(nColumns, // One or two columns.
							vlTable, // Table uses 100% of available width.
							0, // Border thickness.
							VwAlignment.kvaLeft, // Default alignment.
							VwFramePosition.kvfpVoid, // No border.
							//VwFramePosition.kvfpBox,
							//VwRule.kvrlAll, // rule lines between cells
							VwRule.kvrlNone,
							0, //No space between cells.
							0, //No padding inside cells.
							false);

						// Specify column widths. The first argument is the number of columns,
						// not a column index.
						vwenv.MakeColumns(nColumns, vlColumn);
						vwenv.OpenTableBody();
						vwenv.OpenTableRow();

//.........这里部分代码省略.........
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:101,代码来源:DraftViewVc.cs

示例4: Display

		/// <summary></summary>
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			switch(frag)
			{
			case (int)SampleFrags.kfrText:
				if (m_fontName != null && m_fontName.Length > 0)
					vwenv.set_StringProperty((int)FwTextPropType.ktptFontFamily, m_fontName);
				// Force to 12 point.
				vwenv.set_IntProperty((int)FwTextPropType.ktptFontSize,
					(int)FwTextPropVar.ktpvMilliPoint, 12000);
				vwenv.OpenDiv();
				vwenv.AddLazyVecItems((int)SampleTags.ktagTextParas, this, (int)SampleFrags.kfrPara);
				vwenv.CloseDiv();
				break;
			case (int)SampleFrags.kfrPara:
				vwenv.AddStringProp((int)SampleTags.ktagParaContents, this);
				break;
			}
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:20,代码来源:ConverterTest.cs

示例5: Display

			/// ------------------------------------------------------------------------------------
			/// <summary>
			/// This is the main interesting method of displaying objects and fragments of them.
			/// Scripture Footnotes are displayed by displaying each footnote's reference and text.
			/// The text is displayed using the standard view constructor for StText.
			/// </summary>
			/// <param name="vwenv"></param>
			/// <param name="hvo"></param>
			/// <param name="frag"></param>
			/// ------------------------------------------------------------------------------------
			public override void Display(IVwEnv vwenv, int hvo, int frag)
			{
				switch (frag)
				{
					case (int)FootnoteFrags.kfrScripture:
					{
						vwenv.AddLazyVecItems(ScriptureTags.kflidScriptureBooks,
							this, (int)FootnoteFrags.kfrBook);
						break;
					}
					case (int)FootnoteFrags.kfrBook:
					{
						vwenv.AddObjVecItems(ScrBookTags.kflidFootnotes, m_stvc,
							(int)StTextFrags.kfrFootnote);
						break;
					}
					default:
						Debug.Assert(false);
						break;
				}
			}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:31,代码来源:StVcTests.cs

示例6: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This is the main interesting method of displaying objects and fragments of them. Most
		/// subclasses should override.
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		/// <param name="frag"></param>
		/// ------------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			switch (frag)
			{
				case kfragRoot:
					// assume the root object has been loaded (FWR-3171: and not deleted).
					if (hvo > 0)
					{
						var obj = m_cache.ServiceLocator.GetInstance<ICmObjectRepository>().GetObject(hvo);
						if (obj is IReversalIndex)
							m_wsReversal = m_cache.ServiceLocator.WritingSystemManager.GetWsFromStr((obj as IReversalIndex).WritingSystem);
						vwenv.AddLazyVecItems(m_fakeFlid, this, kfragListItem);
					}
					break;
				case kfragListItemInner:
					AddTableRow(vwenv, hvo, frag);
					break;
				case kfragListItem:
					vwenv.AddObjProp(m_tagMe, this, kfragListItemInner);
					break;
				default:
					base.Display(vwenv, hvo, frag);
					break;
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:34,代码来源:XmlBrowseViewBaseVc.cs

示例7: 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

示例8: Display

			/// ------------------------------------------------------------------------------------
			/// <summary>
			/// This is the main interesting method of displaying objects and fragments of them.
			/// A Scripture is displayed by displaying its Books;
			/// and a Book is displayed by displaying its Title and Sections;
			/// and a Section is displayed by displaying its Heading and Content;
			/// which are displayed by using the standard view constructor for StText.
			/// </summary>
			/// <param name="vwenv"></param>
			/// <param name="hvo"></param>
			/// <param name="frag"></param>
			/// ------------------------------------------------------------------------------------
			public override void Display(IVwEnv vwenv, int hvo, int frag)
			{
				CheckDisposed();

				switch (frag)
				{
					case (int)ScrFrags.kfrScripture:
						vwenv.AddLazyVecItems((int)Scripture.ScriptureTags.kflidScriptureBooks,
							this, (int)ScrFrags.kfrBook);
						break;
					case (int)ScrFrags.kfrBook:
						vwenv.OpenDiv();
						vwenv.AddObjProp((int)ScrBook.ScrBookTags.kflidTitle, this,
							(int)StTextFrags.kfrText);
						vwenv.AddLazyVecItems((int)ScrBook.ScrBookTags.kflidSections, this,
							(int)ScrFrags.kfrSection);
						vwenv.CloseDiv();
						break;
					case (int)ScrFrags.kfrSection:
						vwenv.OpenDiv();
						vwenv.AddObjProp((int)ScrSection.ScrSectionTags.kflidHeading, this,
							(int)StTextFrags.kfrText);
						vwenv.AddObjProp((int)ScrSection.ScrSectionTags.kflidContent, this,
							(int)StTextFrags.kfrText);
						vwenv.CloseDiv();
						break;
					case (int)StTextFrags.kfrPara:
						if (m_hvosReadOnly.Contains(hvo))
						{
							vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
								(int)FwTextPropVar.ktpvEnum,
								(int)TptEditable.ktptNotEditable);
						}
						base.Display(vwenv, hvo, frag);
						break;
					default:
						base.Display(vwenv, hvo, frag);
						break;
				}
			}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:52,代码来源:FindReplaceCollectorEnvTests.cs

示例9: 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.kFootnoteDetailsSeparateParas) == DisplayType.kFootnoteDetailsSeparateParas)
						vwenv.AddObjVecItems(m_flid, this, 10);
					if ((m_displayType & DisplayType.kFootnoteDetailsSinglePara) == DisplayType.kFootnoteDetailsSinglePara)
						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.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.
//.........这里部分代码省略.........
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:101,代码来源:SimpleViewVc.cs

示例10: Display

		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// This is the main interesting method of displaying objects and fragments of them.
		/// Here a text is displayed by displaying its paragraphs;
		/// and a paragraph is displayed by invoking its style rule, making a paragraph,
		/// and displaying its contents.
		/// </summary>
		/// <param name="vwenv">view environment</param>
		/// <param name="hvo">id of object to be displayed</param>
		/// <param name="frag">fragment of data</param>
		/// -----------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			CheckDisposed();

			switch(frag)
			{
				case (int)StTextFrags.kfrFootnote:
				{
					if (HandleEmptyText(vwenv, hvo))
						break;
					vwenv.AddObjVecItems((int)StText.StTextTags.kflidParagraphs, this,
						(int)StTextFrags.kfrFootnotePara);
					break;
				}

				case (int)StTextFrags.kfrText:
				{
					if (HandleEmptyText(vwenv, hvo))
						break;
					if (m_fLazy)
					{
						vwenv.AddLazyVecItems((int)StText.StTextTags.kflidParagraphs, this,
							(int)StTextFrags.kfrPara);
					}
					else
					{
						vwenv.AddObjVecItems((int)StText.StTextTags.kflidParagraphs, this,
							(int)StTextFrags.kfrPara);
					}
					break;
				}
				case (int)StTextFrags.kfrFootnoteMarker:
				{
					StFootnote footnote = new StFootnote(Cache, hvo);
					if (footnote.DisplayFootnoteMarker)
						DisplayFootnoteMarker(vwenv);
					break;
				}
				case (int)StTextFrags.kfrLabel:
				{
					// The label is not editable.
					vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
						(int)FwTextPropVar.ktpvEnum,
						(int)TptEditable.ktptNotEditable);
					vwenv.AddString(m_tssLabel);
					break;
				}

				case (int)StTextFrags.kfrPara:
				case (int)StTextFrags.kfrFootnotePara:
				{
					InsertParagraphBody(vwenv, hvo, frag, true, ContentType, this);
					break;
				}

				case (int)StTextFrags.kfrTranslation:
				{
					vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
						(int)FwTextPropVar.ktpvEnum,
						Editable ? (int)TptEditable.ktptIsEditable
						: (int)TptEditable.ktptNotEditable);
					// Display the translation, or its user prompt
					if (!InsertTranslationUserPrompt(vwenv, hvo))
					{
						vwenv.AddStringAltMember((int)CmTranslation.CmTranslationTags.kflidTranslation,
							m_wsDefault, this);
					}
					break;
				}
				case (int)StTextFrags.kfrSegmentFreeTranslations:
					// Hvo is a CmBaseAnnotation of one segment of an StTxtPara.
					if (IsLabelSegment(hvo))
					{
						CmBaseAnnotation segment = (CmBaseAnnotation)CmBaseAnnotation.CreateFromDBObject(Cache, hvo, false);
						vwenv.AddString(GetBackTransLabelText(segment));
						vwenv.AddSimpleRect(ColorUtil.ConvertColorToBGR(this.BackColor), 1200, 0, 0); // a narrow space, font-neutral
					}
					else
					{
						vwenv.AddObjProp(StTxtPara.SegmentFreeTranslationFlid(Cache), this, (int)StTextFrags.kfrFreeTrans);
						vwenv.AddString(OneSpaceString);
					}
					break;
				case (int)StTextFrags.kfrFreeTrans:
					// Hvo is a CmIndirectAnnotation whose Contents are the free/back translation.
					vwenv.set_IntProperty((int)FwTextPropType.ktptBackColor, (int)FwTextPropVar.ktpvDefault,
						(int)ColorUtil.ConvertColorToBGR(SystemColors.Window));
					ITsString tssVal = vwenv.DataAccess.get_MultiStringAlt(hvo,
						(int) CmAnnotation.CmAnnotationTags.kflidComment, BackTranslationWS);
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:WorldPad,代码行数:101,代码来源:StVc.cs

示例11: DisplayChartBody

		private void DisplayChartBody(IVwEnv vwenv)
		{
			vwenv.AddLazyVecItems((int)DsConstChart.DsConstChartTags.kflidRows, this, kfragChartRow);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:4,代码来源:ConstChartBody.cs

示例12: Display

		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			CheckDisposed();
			if (hvo == 0)
				return;		// Can't do anything without an hvo (except crash -- see LT-9348).

#if DEBUG
			//TimeRecorder.Begin("Display");
#endif
			switch (frag)
			{
			case kfragText: // The whole text, root object for the InterlinDocChild.
				vwenv.AddObjProp((int)Text.TextTags.kflidContents, this, kfragStText);
				break;
				//			case kfragTxtSection: // obsolete
				//				// Enhance JohnT: possibly some extra space, bold the heading, or whatever?
				//				vwenv.AddObjProp((int)TxtSection.TxtSectionTags.kflidHeading, this, kfragStText);
				//				vwenv.AddObjProp((int)TxtSection.TxtSectionTags.kflidContents, this, kfragStText);
				//				vwenv.AddLazyVecItems((int)TxtSection.TxtSectionTags.kflidSubsections, this, kfragTxtSection);
				//				break;
			case kfragStText:	// new root object for InterlinDocChild.
				SetupRealVernWsForDisplay(m_cache.LangProject.ActualWs(LangProject.kwsVernInParagraph,
					hvo, (int)StText.StTextTags.kflidParagraphs));
				vwenv.AddLazyVecItems((int)StText.StTextTags.kflidParagraphs, this, kfragInterlinPara);
				break;
			case kfragInterlinPara: // Whole StTxtPara. This can be the root fragment in DE view.
				if (vwenv.DataAccess.get_VecSize(hvo, ktagParaSegments) == 0)
				{
					vwenv.NoteDependency(new int[] {hvo}, new int[] {ktagParaSegments}, 1);
					vwenv.AddString(m_tssEmptyPara);
				}
				else
				{
					PreferredVernWs = m_cache.LangProject.ActualWs(LangProject.kwsVernInParagraph, hvo, ktagParaSegments);
					// Include the plain text version of the paragraph?
					vwenv.AddLazyVecItems(ktagParaSegments, this, kfragParaSegment);
				}
				break;
			case kfragParaSegment:
				// Don't put anything in this segment if it is a 'label' segment (typically containing a verse
				// number for TE).
				CmBaseAnnotation seg = CmObject.CreateFromDBObject(m_cache, hvo, false) as CmBaseAnnotation;
				StTxtPara para = seg.BeginObjectRA as StTxtPara;
				if (SegmentBreaker.HasLabelText(para.Contents.UnderlyingTsString, seg.BeginOffset, seg.EndOffset))
					break;
				// This puts ten points between segments. There's always 5 points below each line of interlinear;
				// if there are no freeform annotations another 5 points makes 10 between segments.
				// If there are freeforms, we need the full 10 points after the last of them.
				int cfreeform = vwenv.DataAccess.get_VecSize(hvo, ktagSegFF);
				vwenv.set_IntProperty((int)FwTextPropType.ktptMarginBottom,
					(int)FwTextPropVar.ktpvMilliPoint, cfreeform == 0 ? 5000 : 10000);
				vwenv.OpenDiv();
				// Enhance JohnT: determine what the overall direction of the paragraph should
				// be and set it.
				if (m_mpBundleHeight == 0)
				{
					// First time...figure it out.
					int dmpx, dmpyAnal, dmpyVern;
					vwenv.get_StringWidth(m_tssEmptyAnalysis, null, out dmpx, out dmpyAnal);
					vwenv.get_StringWidth(m_tssEmptyVern, null, out dmpx, out dmpyVern);
					m_mpBundleHeight = dmpyAnal * 4 + dmpyVern * 3;
				}
				// The interlinear bundles are not editable.
				vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
					(int)FwTextPropVar.ktpvEnum, (int)TptEditable.ktptNotEditable);
				if (m_fRtl)
				{
					vwenv.set_IntProperty((int)FwTextPropType.ktptRightToLeft,
						(int)FwTextPropVar.ktpvEnum, (int)FwTextToggleVal.kttvForceOn);
					vwenv.set_IntProperty((int)FwTextPropType.ktptAlign,
						(int)FwTextPropVar.ktpvEnum, (int) FwTextAlign.ktalRight);
				}
				vwenv.set_IntProperty((int)FwTextPropType.ktptSpellCheck, (int)FwTextPropVar.ktpvEnum,
					(int)SpellingModes.ksmDoNotCheck);
				vwenv.OpenParagraph();
				AddSegmentReference(vwenv, hvo);	// Calculate and display the segment reference.
				AddLabelPile(vwenv, m_tsf, m_cache, true, m_fShowMorphBundles);
				vwenv.AddObjVecItems(ktagSegmentForms, this, kfragBundle);
				// JohnT, 1 Feb 2008. Took this out as I can see no reason for it; AddObjVecItems handles
				// the dependency already. Adding it just means that any change to the forms list
				// regenerates a higher level than needed, which contributes to a great deal of scrolling
				// and flashing (LT-7470).
				// Originally added by Eric in revision 72 on the trunk as part of handling phrases.
				// Eric can't see any reason we need it now, either. If you find a need to re-insert it,
				// please document carefully the reasons it is needed and what bad consequences follow
				// from removing it.
				//vwenv.NoteDependency(new int[] { hvo }, new int[] { ktagSegmentForms }, 1);
				vwenv.CloseParagraph();
				// This puts 3 points of margin on the first FF annotation, if any.
				vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTop,
					(int)FwTextPropVar.ktpvMilliPoint, 0); // 3000
				vwenv.AddObjVec(ktagSegFF, this, kfragSegFf);
				vwenv.CloseDiv();
				break;
			case kfragBundle: // One annotated word bundle; hvo is CmBaseAnnotation.
				// checking AllowLayout (especially in context of Undo/Redo make/break phrase)
				// helps prevent us from rebuilding the display until we've finished
				// reconstructing the data and cache. Otherwise we can crash.
				if (m_rootsite != null && !m_rootsite.AllowLayout)
					return;
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:WorldPad,代码行数:101,代码来源:InterlinVc.cs

示例13: Display

		///// ------------------------------------------------------------------------------------
		///// <summary>
		///// Gets the image padding.
		///// </summary>
		///// ------------------------------------------------------------------------------------
		//private int GetImagePadding(IVwEnv vwenv, stdole.IPicture pic)
		//{
		//    ITsTextProps ttp = StyleUtils.CharStyleTextProps(ScrStyleNames.NotationTag,
		//        m_cache.DefaultUserWs);
		//    ITsStrBldr bldr = TsStrBldrClass.Create();

		//    bldr.Replace(0, 0, "X", ttp);
		//    int dmpX, lineHeight;
		//    vwenv.get_StringWidth(bldr.GetString(), ttp, out dmpX, out lineHeight);

		//    float pixelsY = ((float)m_pixelHeights[pic] - 1f); // *m_zoomPercent;
		//    float inchesY = pixelsY / (float)m_dpiY;
		//    float milliptY = 72000f * inchesY;
		//    return (int)(Math.Abs((float)lineHeight - milliptY) / 2f);
		//}

		#endregion

		#region Overridden methods
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This is the main interesting method of displaying objects and fragments of them.
		/// Scripture Footnotes are displayed by displaying each footnote's reference and text.
		/// The text is displayed using the standard view constructor for StText.
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		/// <param name="frag"></param>
		/// ------------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			CheckDisposed();

			switch (frag)
			{
				case (int)ScrFrags.kfrScripture:
				{
					vwenv.AddObjVecItems((int)Scripture.ScriptureTags.kflidBookAnnotations,
						this, (int)ScrFrags.kfrBook);
					break;
				}
				case (int)ScrFrags.kfrBook:
				{
					// REVIEW: This dependency causes the relevent portions of the view to be
					// re-laid out when the underlying sequence property (kflidNotes) changes
					// because PropChanged never gets called for the virtual property, though
					// maybe it should.
					vwenv.NoteDependency(new int[] { hvo },
						new int[] { (int)ScrBookAnnotations.ScrBookAnnotationsTags.kflidNotes }, 1);
					vwenv.AddLazyVecItems(VirtualNotesTag, this, (int)NotesFrags.kfrAnnotation);
					break;
				}
				case (int)NotesFrags.kfrAnnotation:
				{
					DisplayAnnotationFragment(vwenv, hvo);
					break;
				}
				case (int)NotesFrags.kfrResponse:
				{
					DisplayResponseFragment(vwenv, hvo);
					break;
				}
				case (int)NotesFrags.kfrExpansion:
				{
					vwenv.OpenParagraph();

					//if (m_expanderPadding == -1)
					//    m_expanderPadding = GetImagePadding(vwenv, m_picMinus);

					vwenv.set_IntProperty((int)FwTextPropType.ktptPadTop,
						(int)FwTextPropVar.ktpvMilliPoint, 2500);

					vwenv.AddPicture((m_expandTable.ContainsKey(hvo) && m_expandTable[hvo]) ?
						m_picMinus : m_picPlus,	m_cache.GetOwningFlidOfObject(hvo), 0, 0);

					vwenv.CloseParagraph();
					break;
				}
				default:
					base.Display(vwenv, hvo, frag);
					break;
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:88,代码来源:TeNotesVc.cs

示例14: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This is the main interesting method of displaying objects and fragments of them. Most
		/// subclasses should override.
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		/// <param name="frag"></param>
		/// ------------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			CheckDisposed();

			switch (frag)
			{
				case kfragRoot:
					// assume the root object has been loaded.
					if (hvo != 0)
						vwenv.AddLazyVecItems(m_fakeFlid, this, kfragListItem);
					break;
				case kfragListItemInner:
					AddTableRow(vwenv, hvo, frag);
					break;
				case kfragListItem:
					vwenv.AddObjProp(TagMe, this, kfragListItemInner);
					break;
				default:
					base.Display(vwenv, hvo, frag);
					break;
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:31,代码来源:XmlBrowseViewBaseVc.cs

示例15: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This is the main interesting method of displaying objects and fragments of them.
		/// Scripture Footnotes are displayed by displaying each footnote's reference and text.
		/// The text is displayed using the standard view constructor for StText.
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		/// <param name="frag"></param>
		/// ------------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			switch (frag)
			{
				case (int)StTextFrags.kfrFootnote:
					{
						// FWR-1640: Make the sequence of footnote paragraphs non-editable
						// since we only allow one para per footnote. This will cause
						// pasting multiple paragraphs to work correctly.
						vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
							(int)FwTextPropVar.ktpvEnum,
							(int)TptEditable.ktptNotEditable);
						base.Display(vwenv, hvo, frag);
						break;
					}
				case (int)FootnoteFrags.kfrScripture:
				{
					vwenv.NoteDependency(new int[] { m_cache.LanguageProject.TranslatedScriptureOA.Hvo },
						new int[] { (int)ScriptureTags.kflidScriptureBooks }, 1);
					vwenv.AddLazyVecItems(BooksTag, this, (int)FootnoteFrags.kfrBook);
					break;
				}
				case (int)FootnoteFrags.kfrRootInPageSeq:
				{
					vwenv.AddObjVec(ScrBookTags.kflidFootnotes, this, (int)FootnoteFrags.kfrAllFootnotesWithinPagePara);
					break;
				}
				case (int)FootnoteFrags.kfrFootnoteWithinPagePara:
				{
					// Insert the marker and reference
					vwenv.AddObj(hvo, this, (int)StTextFrags.kfrFootnoteMarker);
					vwenv.AddObj(hvo,  this,(int)StTextFrags.kfrFootnoteReference);

					// Insert (we hope only one) paragraph contents.
					vwenv.AddObjVecItems(StTextTags.kflidParagraphs, this, (int)FootnoteFrags.kfrFootnoteParaWithinPagePara);
					break;
				}
				case (int) FootnoteFrags.kfrFootnoteParaWithinPagePara:
				{
					if (!InsertParaContentsUserPrompt(vwenv, hvo))
					{
						// Display the text paragraph contents, or its user prompt.
						vwenv.AddStringProp(StTxtParaTags.kflidContents, null);
					}
					break;
				}
				case (int)FootnoteFrags.kfrBook:
				{
					vwenv.OpenDiv();
					vwenv.AddObjVecItems(ScrBookTags.kflidFootnotes, this,
						(int)StTextFrags.kfrFootnote);
					vwenv.CloseDiv();
					break;
				}
				case (int)StTextFrags.kfrFootnoteReference:
				{
					DisplayFootnoteReference(vwenv, hvo);
					break;
				}
				default:
					base.Display(vwenv, hvo, frag);
					break;
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:74,代码来源:FootnoteVc.cs


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