• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IVwEnv类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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)
			{
				int frWs = vwenv.DataAccess.WritingSystemFactory.GetWsFromStr("fr");
				int hvoOuter, tag, ihvo;
				ITsString tss;
				switch (frag)
				{
					case 1: // A ScrBook; display the title.
						vwenv.AddObjProp(ScrBookTags.kflidTitle, this, 2);
						break;
					case 2: // An StText; display the paragraphs.
						vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoOuter, out tag, out ihvo);
						tss = TsStringHelper.MakeTSS(
							"Hvo = " + hvoOuter + "; Tag = " + tag + "; Ihvo = " + ihvo,
							frWs);
						vwenv.AddString(tss);
						vwenv.AddObjVecItems(StTextTags.kflidParagraphs, this, 3);
						break;
					case 3: // StTxtPara, display details of our outer object
						vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoOuter, out tag, out ihvo);
						tss = TsStringHelper.MakeTSS(
							"Hvo = " + hvoOuter + "; Tag = " + tag + "; Ihvo = " + ihvo,
							frWs);
						vwenv.AddString(tss);
						break;
					default:
						throw new ApplicationException("Unexpected frag in DummyCollectorEnvVc");
				}
			}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:37,代码来源:CollectorEnvTests.cs


示例2: 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)
			{
				CheckDisposed();

				int hvoOuter, tag, ihvo;
				ITsString tss;
				switch (frag)
				{
					case 1: // A ScrBook; display the title.
						vwenv.AddObjProp((int)ScrBook.ScrBookTags.kflidTitle, this, 2);
						break;
					case 2: // An StText; display the paragraphs.
						vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoOuter, out tag, out ihvo);
						tss = TsStringHelper.MakeTSS(
							"Hvo = " + hvoOuter + "; Tag = " + tag + "; Ihvo = " + ihvo,
							InMemoryFdoCache.s_wsHvos.Fr);
						vwenv.AddString(tss);
						vwenv.AddObjVecItems((int)StText.StTextTags.kflidParagraphs, this, 3);
						break;
					case 3: // StTxtPara, display details of our outer object
						vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoOuter, out tag, out ihvo);
						tss = TsStringHelper.MakeTSS(
							"Hvo = " + hvoOuter + "; Tag = " + tag + "; Ihvo = " + ihvo,
							InMemoryFdoCache.s_wsHvos.Fr);
						vwenv.AddString(tss);
						break;
					default:
						throw new ApplicationException("Unexpected frag in DummyCollectorEnvVc");
				}
			}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:38,代码来源:CollectorEnvTests.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();

			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


示例4: Display

		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			switch (frag)
			{
			default:
				break;
			case kfrBook:
				vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptFontSize, (int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 24000);
				vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptBold, (int)FwKernelLib.FwTextPropVar.ktpvEnum,
					(int)FwKernelLib.FwTextToggleVal.kttvOn);
				vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptAlign, (int)FwKernelLib.FwTextPropVar.ktpvEnum,
					(int)FwKernelLib.FwTextAlign.ktalCenter);

				vwenv.AddStringProp(ktagBookName, this);
				vwenv.AddLazyVecItems(ktagBookSections, this, kfrSection);
				break;
			case kfrSection:
				vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptItalic, (int)FwKernelLib.FwTextPropVar.ktpvEnum,
					(int)FwKernelLib.FwTextToggleVal.kttvOn);
				vwenv.OpenParagraph();
				vwenv.AddStringProp(ktagSectionTitle, this);
				vwenv.AddString(m_tssLeftParen);
				vwenv.AddStringProp(ktagSectionRefs, this);
				vwenv.AddString(m_tssRightParen);
				vwenv.CloseParagraph();
				vwenv.AddLazyVecItems(ktagSectionParas, this, kfrDoublePara);
				break;
			case kfrDoublePara:
				AddDoublePara(vwenv, hvo);
				// Now insert an interlinear version of the paragraph. This is basically editable.
				vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptBackColor,
					(int)FwKernelLib.FwTextPropVar.ktpvDefault, m_colorEditable);
				vwenv.OpenParagraph();
				vwenv.AddObjVecItems(ktagParaBundles, this, kfrBundle);
				vwenv.CloseParagraph();
				break;
			case kfrBundle:
				// Put a little space after each bundle to separate them.
				vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptMarginTrailing,
					(int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 5000);
				vwenv.OpenInnerPile();
				vwenv.AddStringProp(ktagBundleBase, this);

				vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptBold,
					(int)FwKernelLib.FwTextPropVar.ktpvEnum,
					(int)FwKernelLib.FwTextToggleVal.kttvOn);
				vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptFontSize,
					(int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 13000);
				vwenv.AddStringProp(ktagBundleIdiom, this);

				vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptFontSize,
					(int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 8000);
				vwenv.AddStringProp(ktagBundleLing, this);
				vwenv.CloseInnerPile();

				break;
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:58,代码来源:ViewSampleVc.cs


示例5: HvoOfObjectToDisplay

		protected override int HvoOfObjectToDisplay(IVwEnv vwenv, int hvo)
		{
			ISilDataAccess sda = vwenv.DataAccess;
			int chvo = sda.get_VecSize(hvo, m_flid);
			if (chvo < 1)
				return 0;
			else
				return sda.get_VecItem(hvo, m_flid, 0);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:9,代码来源:LexReferenceTreeRootView.cs


示例6: Display

		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			switch (frag)
			{
				default:
					break;
				case HelloViewView.kfrText:
					vwenv.AddStringProp(HelloViewView.ktagProp, this);
					break;
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:11,代码来源:HelloViewVc.cs


示例7: HvoOfObjectToDisplay

		protected override int HvoOfObjectToDisplay(IVwEnv vwenv, int hvo)
		{
			ISilDataAccess sda = vwenv.DataAccess;
			int chvo = sda.get_VecSize(hvo, m_flid);
			if (chvo < 2)
				return 0;
			int hvoItem = sda.get_VecItem(hvo, m_flid, 0);
			if (hvoItem == m_hvoDisplayParent)
				hvoItem = sda.get_VecItem(hvo, m_flid, 1);
			return hvoItem;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:11,代码来源:LexReferencePairView.cs


示例8: XmlVcDisplayVec

		/// <summary>
		/// The method object's constructor.
		/// </summary>
		/// <param name="vc">The view constructor</param>
		/// <param name="vwenv">The view environment</param>
		/// <param name="hvo">A handle on the root object</param>
		/// <param name="flid">The field ID</param>
		/// <param name="frag">A code identifying the current part of the display</param>
		public XmlVcDisplayVec(XmlVc vc, IVwEnv vwenv, int hvo, int flid, int frag)
		{
			m_viewConstructor = vc;
			m_vwEnv = vwenv;
			m_hvo = hvo;
			m_flid = flid;
			m_frag = frag;
			m_cache = m_viewConstructor.Cache;
			m_sda = m_viewConstructor.DataAccess;
			if (vwenv.DataAccess != null)
				m_sda = vwenv.DataAccess;
			m_objRepo = m_cache.ServiceLocator.GetInstance<ICmObjectRepository>();
			m_stringTable = m_viewConstructor.StringTbl;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:22,代码来源:XmlVcDisplayVec.cs


示例9: DisplayVec

		/// <summary>
		/// Calling vwenv.AddObjVec() in Display() and implementing DisplayVec() seems to
		/// work better than calling vwenv.AddObjVecItems() in Display().  Theoretically
		/// this should not be case, but experience trumps theory every time.  :-) :-(
		/// </summary>
		public override void DisplayVec(IVwEnv vwenv, int hvo, int tag, int frag)
		{
			CheckDisposed();

			ISilDataAccess da = vwenv.DataAccess;
			int count = da.get_VecSize(hvo, tag);
			// Tree Branches consist of everything FOLLOWING the first element which is the Tree root.
			for (int i = 1; i < count; ++i)
			{
				vwenv.AddObj(da.get_VecItem(hvo, tag, i), this,
					VectorReferenceView.kfragTargetObj);
				vwenv.AddSeparatorBar();
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:19,代码来源:LexReferenceTreeBranchesView.cs


示例10: 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)
		{
			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(ScriptureTags.kflidChapterLabel, this);
					vwenv.AddLazyVecItems(ScriptureTags.kflidScriptureBooks, this,
						kfragLazyBook);
					break;
				}
				case kfragLazyBook:
				{
					vwenv.AddLazyVecItems(ScrBookTags.kflidSections, this,
						kfragDummySection);
					break;
				}
				case kfragDummySection:
				{
					vwenv.AddObjProp(ScrSectionTags.kflidHeading, this,
						kfragDummyStText);
					vwenv.AddObjProp(ScrSectionTags.kflidContent, this,
						kfragDummyStText);
					break;
				}
				case kfragDummyStText:
				{
					vwenv.AddObjVecItems(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(StTxtParaTags.kflidContents, null);
					vwenv.CloseParagraph();
					break;
				}
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:57,代码来源:LazyPrintLayoutTests.cs


示例11: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Display some simple rectangles to represent a header and a footer.
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		/// <param name="frag"></param>
		/// ------------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			// Display each dummy header or footer as a rectangle, which allows us
			// to accurately predict the height.
			switch(hvo)
			{
				case DummyHeaderFooterConfigurer.khvoHeader:
					vwenv.AddSimpleRect(0, MiscUtils.kdzmpInch, MiscUtils.kdzmpInch / 4, 0);
					break;
				case DummyHeaderFooterConfigurer.khvoFooter:
					vwenv.AddSimpleRect(0, MiscUtils.kdzmpInch, MiscUtils.kdzmpInch, 0);
					break;
				default:
					Assert.Fail();
					break;
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:25,代码来源:HeaderFooterLayoutTests.cs


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


示例13: Display

		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			switch (frag)
			{
				default:
					break;
				case InterlinearView.kfrText:
					vwenv.OpenParagraph();
					vwenv.AddObjVecItems(InterlinearView.ktagText_Words, this, InterlinearView.kfrWord);
					vwenv.CloseParagraph();
					break;
				case InterlinearView.kfrWord:
					vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptMarginTrailing,
												(int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 10000);
					vwenv.OpenInnerPile();
					vwenv.AddStringProp(InterlinearView.ktagWord_Form, this);
					vwenv.AddStringProp(InterlinearView.ktagWord_Type, this);
					vwenv.CloseInnerPile();
					break;
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:21,代码来源:InterlinearVc.cs


示例14: 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 kfragScrFootnotes:
					{
						vwenv.AddObjVecItems((int)Scripture.ScriptureTags.kflidScriptureBooks, this,
							kfragBookFootnotes);
						break;
					}
				case kfragBookFootnotes:
					{
						vwenv.AddObjVecItems((int)ScrBook.ScrBookTags.kflidFootnotes, this,
							kfragFootnote);
						break;
					}
				case kfragFootnote:
					{

						// Display each dummy footnote as a rectangle a half inch high, which allows us
						// to accurately predict the height of a known number of them. Also put in a very
						// short editable string, which we use for some other tests, but should not
						// affect the paragraph height.
						vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTop,
							(int)FwTextPropVar.ktpvMilliPoint, MiscUtils.kdzmpInch / 10);
						vwenv.set_IntProperty((int)FwTextPropType.ktptMarginBottom,
							(int)FwTextPropVar.ktpvMilliPoint, MiscUtils.kdzmpInch / 5);
						vwenv.OpenParagraph();
						if (m_fWantStrings)
							vwenv.AddStringProp((int)StFootnote.StFootnoteTags.kflidFootnoteMarker, this);
						vwenv.AddSimpleRect(0, MiscUtils.kdzmpInch / 2, MiscUtils.kdzmpInch / 2, 0);
						vwenv.CloseParagraph();
						break;
					}
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:46,代码来源:PrintLayoutTests.cs


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


示例16: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This is the main interesting method of displaying objects and fragments of them.
		/// This override provides special difference highlighting for a footnote paragraph.
		/// </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.kfrFootnotePara:
				{
					IScrTxtPara para = Cache.ServiceLocator.GetInstance<IScrTxtParaRepository>().GetObject(hvo);
					// Even if we don't display BT yet we want to create the translations, so
					// it will be included in the undo action sequence.
					// Otherwise we're having problems with Undo after the Diff dialog
					// is closed (TE-4896).
					GetTranslationForPara(para.Hvo);

					m_DispPropOverrides.Clear();

					// If the given footnote paragraph has differences to be highlighted,
					//  add appropriate properties.

					// Note: When the diff type is ParagraphMissingInCurrent, we don't scan the new
					// para for text diffs - we will just copy all of it including its footnotes.
					// So there may be no sub-diffs created for the footnotes present. Thus we won't
					// be highlighting those footnotes.
					if (m_fNeedHighlight)
						AddOverridesToHighlightFootnoteDiff(para);

					// the base Display will do the actual displaying of the FootnotePara frag
					base.Display(vwenv, hvo, frag);
					break;
				}

				default:
					// handle all other frags
					base.Display(vwenv, hvo, frag);
					break;
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:45,代码来源:DiffFootnoteVc.cs


示例17: DisplayVec

		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// Handles displaying the vector of words with commas except after the last
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		/// <param name="tag"></param>
		/// <param name="frag"></param>
		/// -----------------------------------------------------------------------------------
		public override void DisplayVec(IVwEnv vwenv, int hvo, int tag, int frag)
		{
			CheckDisposed();

			Debug.Assert(frag == kfragWords);
			ISilDataAccess sda = vwenv.DataAccess;
			int cwords = sda.get_VecSize(hvo, ktagWords);
			for (int i = 0; i < cwords; i++)
			{
				vwenv.AddObj(sda.get_VecItem(hvo, ktagWords, i), this, kfragName);
				if (i != cwords - 1)
					vwenv.AddString(m_tssComma);
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:23,代码来源:RelatedWords.cs


示例18: Display

		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// This is the main interesting method of displaying objects and fragments of them.
		/// </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:
					ITsString tssWord = vwenv.DataAccess.get_StringProp(hvo, ktagCf);
					ITsStrBldr tsbSdRelation = m_tssSdRelation.GetBldr();
					ITsStrBldr tsbLexRel = m_tssLexRelation.GetBldr();
					if (tssWord != null && tssWord.Length > 0)
					{
						int ich = tsbSdRelation.Text.IndexOf("{0}");
						if (ich >= 0)
							tsbSdRelation.ReplaceTsString(ich, ich + 3, tssWord);
						ich = tsbLexRel.Text.IndexOf("{0}");
						if (ich >= 0)
							tsbLexRel.ReplaceTsString(ich, ich + 3, tssWord);
					}
					int cDomains = vwenv.DataAccess.get_VecSize(hvo, ktagDomains);
					int cLexRels = vwenv.DataAccess.get_VecSize(hvo, ktagLexRels);
					Debug.Assert(cDomains > 0 || cLexRels > 0);
					if (cDomains > 0)
					{
						vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
							(int)FwTextPropVar.ktpvEnum,
							(int)TptEditable.ktptNotEditable);
						vwenv.set_IntProperty((int)FwTextPropType.ktptMarginBottom,
							(int)FwTextPropVar.ktpvMilliPoint,
							6000);
						vwenv.OpenParagraph();
						vwenv.AddString(tsbSdRelation.GetString());
						vwenv.CloseParagraph();
						vwenv.AddLazyVecItems(ktagDomains, this, kfragEntryList);
					}
					if (cLexRels > 0)
					{
						vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
							(int)FwTextPropVar.ktpvEnum,
							(int)TptEditable.ktptNotEditable);
						vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTop,
							(int)FwTextPropVar.ktpvMilliPoint, 6000);
						vwenv.set_IntProperty((int)FwTextPropType.ktptMarginBottom,
							(int)FwTextPropVar.ktpvMilliPoint, 6000);
						vwenv.OpenParagraph();
						vwenv.AddString(tsbLexRel.GetString());
						vwenv.CloseParagraph();
						vwenv.AddLazyVecItems(ktagLexRels, this, kfragEntryList);
					}
					break;
				case kfragEntryList:
					vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
						(int)FwTextPropVar.ktpvEnum,
						(int)TptEditable.ktptNotEditable);
					vwenv.OpenParagraph();
					vwenv.set_IntProperty((int)FwTextPropType.ktptBold,
						(int)FwTextPropVar.ktpvEnum,
						(int)FwTextToggleVal.kttvForceOn);
					vwenv.AddStringProp(ktagName, this);
					vwenv.AddString (m_tssColon);
					vwenv.AddObjVec(ktagWords, this, kfragWords);
					vwenv.CloseParagraph();
					break;
				case kfragName:
					vwenv.AddStringProp(ktagName, this);
					break;
				default:
					throw new Exception("bad case in RelatedWordsVc.Display");
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:78,代码来源:RelatedWords.cs


示例19: LoadDataFor

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// pre-load any required data about a particular domain.
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="rghvo"></param>
		/// <param name="chvo"></param>
		/// <param name="hvoParent"></param>
		/// <param name="tag"></param>
		/// <param name="frag"></param>
		/// <param name="ihvoMin"></param>
		/// ------------------------------------------------------------------------------------
		public override void LoadDataFor(IVwEnv vwenv, int[] rghvo, int chvo, int hvoParent,
			int tag, int frag, int ihvoMin)
		{
			CheckDisposed();

			// Nothing to do, all data already loaded.
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:19,代码来源:RelatedWords.cs


示例20: AddWordBundleInternal

		protected override void AddWordBundleInternal(int hvo, IVwEnv vwenv)
		{
			// Determine whether it is the focus box occurrence.
			if (FocusBoxOccurrence != null)
			{
				int hvoSeg, tag, ihvo;
				vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoSeg, out tag, out ihvo);
				if (hvoSeg == FocusBoxOccurrence.Segment.Hvo && ihvo == FocusBoxOccurrence.Index)
				{
					// Leave room for the Sandbox instead of displaying the internlinear data.
					// The first argument makes it invisible in case a little bit of it shows around
					// the sandbox.
					// The last argument puts the 'Baseline' of the sandbox (which aligns with the base of the
					// first line of text) an appropriate distance from the top of the Sandbox. This aligns it's
					// top line of text properly.
					// Enhance JohnT: 90% of font height is not always exactly right, but it's the closest
					// I can get wihtout a new API to get the exact ascent of the font.
					int dympBaseline = Common.Widgets.FontHeightAdjuster.
						GetFontHeightForStyle("Normal", m_stylesheet, m_wsVernForDisplay,
						m_cache.LanguageWritingSystemFactoryAccessor) * 9 / 10;
					uint transparent = 0xC0000000; // FwTextColor.kclrTransparent won't convert to uint
					vwenv.AddSimpleRect((int)transparent,
										FocusBoxSize.Width, FocusBoxSize.Height, -(FocusBoxSize.Height - dympBaseline));
					return;
				}
			}
			base.AddWordBundleInternal(hvo, vwenv);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:28,代码来源:InterlinDocForAnalysis.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IVwGraphics类代码示例发布时间:2022-05-24
下一篇:
C# IVsWindowFrame类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap