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


C# IVwEnv类代码示例

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


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


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