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


C# IVwEnv.OpenParagraph方法代码示例

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


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

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

示例2: 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 kfragScrFootnotes:
					{
						vwenv.AddObjVecItems(ScriptureTags.kflidScriptureBooks, this,
							kfragBookFootnotes);
						break;
					}
				case kfragBookFootnotes:
					{
						vwenv.AddObjVecItems(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(StFootnoteTags.kflidFootnoteMarker, this);
						vwenv.AddSimpleRect(0, MiscUtils.kdzmpInch / 2, MiscUtils.kdzmpInch / 2, 0);
						vwenv.CloseParagraph();
						break;
					}
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:44,代码来源:PrintLayoutTests.cs

示例3: Display

			public override void Display(IVwEnv vwenv, int hvo, int frag)
			{
				CheckDisposed();
				switch (frag)
				{
				case PhoneEnvReferenceView.kFragEnvironmentObj:
					vwenv.AddStringProp(PhoneEnvReferenceView.kEnvStringRep, this);
					break;
				case PhoneEnvReferenceView.kFragEnvironments:
					vwenv.OpenParagraph();
					vwenv.AddObjVec(PhoneEnvReferenceView.kMainObjEnvironments, this, frag);
					vwenv.CloseParagraph();
					break;
					//case PhoneEnvReferenceView.kFragAnnotation:
					//	break;
				default:
					throw new ArgumentException(
						"Don't know what to do with the given frag.", "frag");
				}
			}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:20,代码来源:PhoneEnvReferenceView.cs

示例4: Display


//.........这里部分代码省略.........
					case ReversalIndexEntrySliceView.kFragIndexMain:
					{
						// First cell has writing system abbreviation displayed using m_ttpLabel.
						int wsHvo = 0;
						foreach (ReversalIndex idx in m_usedIndices)
						{
							if (idx.Hvo == hvo)
							{
								wsHvo = idx.WritingSystemRAHvo;
								break;
							}
						}
						Debug.Assert(wsHvo > 0, "Could not find writing system.");

						int wsOldDefault = this.DefaultWs;
						this.DefaultWs = wsHvo;

						// Cell 1 shows the ws abbreviation.
						vwenv.OpenTableCell(1,1);
						vwenv.Props = m_ttpLabel;
						vwenv.AddObj(wsHvo, this, ReversalIndexEntrySliceView.kFragWsAbbr);
						vwenv.CloseTableCell();

						// Second cell has the contents for the reversal entries.
						vwenv.OpenTableCell(1,1);
						// This displays the field flush right for RTL data, but gets arrow keys to
						// behave reasonably.  See comments on LT-5287.
						IWritingSystem lgws = m_cache.LanguageWritingSystemFactoryAccessor.get_EngineOrNull(this.DefaultWs);
						if (lgws != null && lgws.RightToLeft)
						{
							vwenv.set_IntProperty((int)FwTextPropType.ktptRightToLeft,
								(int)FwTextPropVar.ktpvEnum, (int)FwTextToggleVal.kttvForceOn);
						}
						vwenv.OpenParagraph();
						// Do vector of entries in the second column.
						vwenv.AddObjVec(ReversalIndexEntrySliceView.kFlidEntries, this, ReversalIndexEntrySliceView.kFragEntries);
						vwenv.CloseParagraph();
						vwenv.CloseTableCell();

						this.DefaultWs = wsOldDefault;
						break;
					}
					case ReversalIndexEntrySliceView.kFragEntryForm:
					{
						vwenv.AddStringAltMember((int)ReversalIndexEntry.ReversalIndexEntryTags.kflidReversalForm,
							this.DefaultWs, this);
						int hvoCurrent = vwenv.CurrentObject();
						if (hvoCurrent > 0)
						{
							IReversalIndexEntry rie = ReversalIndexEntry.CreateFromDBObject(m_cache, hvoCurrent);
							Debug.Assert(rie != null);
							int[] rgWs = m_cache.LangProject.GetReversalIndexWritingSystems(rie.Hvo, false);
							int wsAnal = m_cache.DefaultAnalWs;
							ITsIncStrBldr tisb = TsIncStrBldrClass.Create();
							tisb.SetIntPropValues((int)FwTextPropType.ktptWs,
								(int)FwTextPropVar.ktpvDefault, wsAnal);
							tisb.SetIntPropValues((int)FwTextPropType.ktptEditable,
								(int)FwTextPropVar.ktpvEnum,
								(int)TptEditable.ktptNotEditable);
							tisb.Append(" [");
							int cstr = 0;
							ITsTextProps ttpBase = null;
							for (int i = 0; i < rgWs.Length; ++i)
							{
								int ws = rgWs[i];
								if (ws == this.DefaultWs)
开发者ID:sillsdev,项目名称:WorldPad,代码行数:67,代码来源:ReversalIndexEntrySlice.cs

示例5: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// The main method just displays the text with the appropriate properties.
		/// </summary>
		/// <param name="vwenv">The view environment</param>
		/// <param name="hvo">The HVo of the object to display</param>
		/// <param name="frag">The fragment to lay out</param>
		/// ------------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			CheckDisposed();

			switch (frag)
			{
				case InnerFwListBox.kfragRoot:
					Font f = m_listbox.Font;
					if (m_listbox.StyleSheet == null)
					{
						// Try to get items a reasonable size based on whatever font has been set for the
						// combo as a whole. We don't want to do this if a stylesheet has been set, because
						// it will override the sizes specified in the stylesheet.
						// Enhance JohnT: there are several more properties we could readily copy over
						// from the font, but this is a good start.
						vwenv.set_IntProperty((int)FwTextPropType.ktptFontSize,
							(int)FwTextPropVar.ktpvMilliPoint, (int)(f.SizeInPoints * 1000));
					}
					// Setting the font family here appears to override the fonts associated with the
					// TsString data.  This causes trouble for non-Microsoft Sans Serif writing systems.
					// See LT-551 for the bug report that revealed this problem.
					//				vwenv.set_StringProperty((int) FwTextPropType.ktptFontFamily,
					//					f.FontFamily.Name);
					vwenv.set_IntProperty((int)FwTextPropType.ktptForeColor,
						(int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(m_listbox.ForeColor));
					DisplayList(vwenv);
					break;
				case InnerFwListBox.kfragItems:
					int index, hvoDummy, tagDummy;
					int clev = vwenv.EmbeddingLevel;
					vwenv.GetOuterObject(clev - 1, out hvoDummy, out tagDummy, out index);
					bool fHighlighted = m_listbox.Owner.IsHighlighted(index);
					if (fHighlighted && m_listbox.ShowHighlight)
					{
						vwenv.set_IntProperty((int)FwTextPropType.ktptForeColor,
							(int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.FromKnownColor(KnownColor.HighlightText)));
						vwenv.set_IntProperty((int)FwTextPropType.ktptBackColor,
							(int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.FromKnownColor(KnownColor.Highlight)));
					}
					vwenv.OpenParagraph();
					if (fHighlighted && m_listbox.ShowHighlight)
					{
						// Insert a string that has the foreground color not set, so the foreground color set above can take effect.
						ITsStrBldr bldr = vwenv.DataAccess.get_StringProp(hvo, InnerFwListBox.ktagText).GetBldr();
						bldr.SetIntPropValues(0, bldr.Length, (int) FwTextPropType.ktptForeColor, -1, -1);
						vwenv.AddString(bldr.GetString());
					}
					else
					{
						vwenv.AddStringProp(InnerFwListBox.ktagText, this);
					}
					vwenv.AddString(m_tssBlanks);
					vwenv.CloseParagraph();
					break;
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:64,代码来源:FwListBox.cs

示例6: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// The main method just displays the text with the appropriate properties.
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		/// <param name="frag"></param>
		/// ------------------------------------------------------------------------------------
		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			vwenv.set_IntProperty((int)FwTextPropType.ktptForeColor,
				(int)FwTextPropVar.ktpvDefault, (int)RGB(m_innerTextBox.ForeColor));

			if (m_rtl)
			{
				vwenv.set_IntProperty((int)FwTextPropType.ktptRightToLeft,
					(int)FwTextPropVar.ktpvEnum, (int)FwTextToggleVal.kttvForceOn);
			}
			vwenv.set_IntProperty((int)FwTextPropType.ktptAlign,
				(int)FwTextPropVar.ktpvEnum, (int)m_innerTextBox.Alignment);

			vwenv.OpenParagraph();
			vwenv.AddStringProp(InnerFwTextBox.ktagText, this);
			if (m_fSaveSize)
			{
				ITsString tss = vwenv.DataAccess.get_StringProp(hvo, InnerFwTextBox.ktagText);
				vwenv.get_StringWidth(tss, null, out m_dxWidth, out m_dyHeight);
			}
			vwenv.CloseParagraph();
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:30,代码来源:FwTextBox.cs

示例7: OpenSingleLinePile

		protected void OpenSingleLinePile(IVwEnv vwenv, int maxNumLines, bool addBoundary)
		{
			vwenv.Props = m_pileProps;
			vwenv.OpenInnerPile();
			AddExtraLines(maxNumLines - 1, vwenv);
			vwenv.OpenParagraph();
			if (addBoundary)
			{
				vwenv.Props = m_bracketProps;
				vwenv.AddProp(ktagLeftBoundary, this, kfragZeroWidthSpace);
			}
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:12,代码来源:PatternVcBase.cs

示例8: Display

		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			CheckDisposed();

			ITsStrFactory tsf = null;
			switch (frag)
			{
				case kfragStText: // The whole text, root object for the InterlinDocChild.
					if (hvo == 0)
						return;		// What if the user deleted all the texts?  See LT-6727.
					vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
						(int)FwTextPropVar.ktpvDefault,
						(int)TptEditable.ktptNotEditable);
					vwenv.OpenDiv();
					StText stText = new StText(m_cache, hvo);
					vwenv.set_IntProperty((int)FwTextPropType.ktptMarginBottom,
						(int)FwTextPropVar.ktpvMilliPoint, 6000);
					vwenv.set_IntProperty((int)FwTextPropType.ktptFontSize,
						(int)FwTextPropVar.ktpvMilliPoint, 24000);
					// Add both vernacular and analysis if we have them (LT-5561).
					bool fAddedVernacular = false;
					int wsVernTitle = 0;
					//
					if (stText.Title.TryWs(LangProject.kwsFirstVern, out wsVernTitle))
					{
						vwenv.OpenParagraph();
						vwenv.AddStringAltMember(vtagStTextTitle, wsVernTitle, this);
						vwenv.CloseParagraph();
						fAddedVernacular = true;
					}
					int wsAnalysisTitle = 0;
					vwenv.set_IntProperty((int)FwTextPropType.ktptMarginBottom,
						(int)FwTextPropVar.ktpvMilliPoint, 10000);
					vwenv.OpenParagraph();
					ITsString tssAnal;
					if (stText.Title.TryWs(LangProject.kwsFirstAnal, out wsAnalysisTitle, out tssAnal) &&
						!tssAnal.Equals(stText.Title.BestVernacularAlternative))
					{
						if (fAddedVernacular)
						{
							// display analysis title at smaller font size.
							vwenv.set_IntProperty((int)FwTextPropType.ktptFontSize,
								(int)FwTextPropVar.ktpvMilliPoint, 12000);
						}
						vwenv.AddStringAltMember(vtagStTextTitle, wsAnalysisTitle, this);
					}
					else
					{
						// just add a blank title.
						tsf = TsStrFactoryClass.Create();
						ITsString blankTitle = tsf.MakeString("", m_wsAnalysis);
						vwenv.AddString(blankTitle);
					}
					vwenv.CloseParagraph();
					int wsSource = 0;
					ITsString tssSource = stText.SourceOfTextForWs(m_wsVernForDisplay);
					if (tssSource == null || tssSource.Length == 0)
					{
						tssSource = stText.SourceOfTextForWs(m_wsAnalysis);
						if (tssSource != null && tssSource.Length > 0)
							wsSource = m_wsAnalysis;
					}
					else
					{
						wsSource = m_wsVernForDisplay;
					}
					vwenv.set_IntProperty((int)FwTextPropType.ktptMarginBottom,
						(int)FwTextPropVar.ktpvMilliPoint, 10000);
					if (tssSource != null && tssSource.Length > 0)
					{
						vwenv.OpenParagraph();
						vwenv.set_IntProperty((int)FwTextPropType.ktptFontSize,
							(int)FwTextPropVar.ktpvMilliPoint, 12000);
						vwenv.AddStringAltMember(vtagStTextSource, wsSource, this);
						vwenv.CloseParagraph();
					}
					else
					{
						// just add a blank source.
						tsf = TsStrFactoryClass.Create();
						ITsString tssBlank = tsf.MakeString("", m_wsAnalysis);
						vwenv.AddString(tssBlank);
					}
					vwenv.set_IntProperty((int)FwTextPropType.ktptMarginBottom,
						(int)FwTextPropVar.ktpvMilliPoint, 10000);
					vwenv.OpenParagraph();
					if (stText.OwningFlid == (int)Text.TextTags.kflidContents)
					{
						vwenv.AddObjProp((int)CmObjectFields.kflidCmObject_Owner, this, kfragTextDescription);
					}
					vwenv.CloseParagraph();
					base.Display(vwenv, hvo, frag);
					vwenv.CloseDiv();
					break;
				case kfragTextDescription:
					vwenv.AddStringAltMember((int)CmMajorObject.CmMajorObjectTags.kflidDescription, m_wsAnalysis, this);
					break;
				case kfragSegFf: // One freeform annotation.
					int[] wssAnalysis = m_WsList.AnalysisWsIds;
					if (wssAnalysis.Length == 0)
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:WorldPad,代码行数:101,代码来源:InterlinPrintView.cs

示例9: InsertMissingContentPara

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Inserts the missing content paragraph.
		/// </summary>
		/// <param name="vwenv">The view environment.</param>
		/// ------------------------------------------------------------------------------------
		private void InsertMissingContentPara(IVwEnv vwenv)
		{
			vwenv.OpenParagraph();
			vwenv.set_IntProperty((int)FwTextPropType.ktptBackColor,
				(int)FwTextPropVar.ktpvDefault, (int)kHighlightColor);
			vwenv.set_IntProperty((int)FwTextPropType.ktptBold,
				(int)FwTextPropVar.ktpvEnum, (int)FwTextToggleVal.kttvForceOn);
			vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTop,
				(int)FwTextPropVar.ktpvMilliPoint, 10000);
			vwenv.set_IntProperty((int)FwTextPropType.ktptMarginBottom,
				(int)FwTextPropVar.ktpvMilliPoint, 10000);
			vwenv.AddString(TsStringUtils.MakeTss(
				TeDiffViewResources.kstidContentMissing, Cache.DefaultUserWs));
			vwenv.CloseParagraph();
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:21,代码来源:DiffViewVc.cs

示例10: Display

		public override void Display(IVwEnv vwenv, int hvo, int frag)
		{
			switch (frag)
			{
				case kfragRule:
					m_rule = m_cache.ServiceLocator.GetInstance<IPhMetathesisRuleRepository>().GetObject(hvo);
					if (m_rule.Disabled)
					{
						vwenv.set_StringProperty((int)FwTextPropType.ktptNamedStyle, "Disabled Text");
					}

					int maxNumLines = GetMaxNumLines();

					VwLength tableLen;
					tableLen.nVal = 10000;
					tableLen.unit = VwUnit.kunPercent100;
					vwenv.OpenTable(5, tableLen, 0, VwAlignment.kvaCenter, VwFramePosition.kvfpVoid, VwRule.kvrlNone, 0, 4000, false);

					VwLength ctxtLen;
					ctxtLen.nVal = 1;
					ctxtLen.unit = VwUnit.kunRelative;

					int resultx, inputx, dmpy;
					vwenv.get_StringWidth(m_resultStr, m_colHeaderProps, out resultx, out dmpy);
					vwenv.get_StringWidth(m_inputStr, m_colHeaderProps, out inputx, out dmpy);
					VwLength headerLen;
					headerLen.nVal = Math.Max(resultx, inputx) + 8000;
					headerLen.unit = VwUnit.kunPoint1000;

					vwenv.MakeColumns(1, headerLen);
					vwenv.MakeColumns(4, ctxtLen);

					vwenv.OpenTableBody();

					vwenv.OpenTableRow();

					vwenv.OpenTableCell(1, 1);
					vwenv.CloseTableCell();

					// left context header cell
					vwenv.Props = m_colHeaderProps;
					vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, 1000);
					vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading, (int)FwTextPropVar.ktpvMilliPoint, 1000);
					vwenv.OpenTableCell(1, 1);
					vwenv.AddString(m_leftEnvStr);
					vwenv.CloseTableCell();

					// switch header cell
					vwenv.Props = m_colHeaderProps;
					vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, 2000);
					vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading, (int)FwTextPropVar.ktpvMilliPoint, 2000);
					vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTrailing, (int)FwTextPropVar.ktpvMilliPoint, 2000);
					vwenv.OpenTableCell(1, 2);
					vwenv.AddString(m_switchStr);
					vwenv.CloseTableCell();

					// right context header cell
					vwenv.Props = m_colHeaderProps;
					vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, 1000);
					vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTrailing, (int)FwTextPropVar.ktpvMilliPoint, 1000);
					vwenv.OpenTableCell(1, 1);
					vwenv.AddString(m_rightEnvStr);
					vwenv.CloseTableCell();

					vwenv.CloseTableRow();

					vwenv.OpenTableRow();

					// input header cell
					vwenv.Props = m_rowHeaderProps;
					vwenv.OpenTableCell(1, 1);
					vwenv.AddString(m_inputStr);
					vwenv.CloseTableCell();

					// input left context cell
					vwenv.Props = m_inputCtxtProps;
					vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, 1000);
					vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading, (int)FwTextPropVar.ktpvMilliPoint, 1000);
					vwenv.set_IntProperty((int)FwTextPropType.ktptBorderBottom, (int)FwTextPropVar.ktpvMilliPoint, 1000);
					vwenv.OpenTableCell(1, 1);
					vwenv.OpenParagraph();
					if (m_rule.LeftEnvIndex == -1)
					{
						OpenSingleLinePile(vwenv, maxNumLines, false);
						vwenv.Props = m_bracketProps;
						vwenv.AddProp(ktagLeftEnv, this, kfragEmpty);
						CloseSingleLinePile(vwenv, false);
					}
					else
					{
						for (int i = 0; i < m_rule.LeftEnvLimit; i++)
							vwenv.AddObj(m_rule.StrucDescOS[i].Hvo, this, kfragContext);
					}
					vwenv.CloseParagraph();
					vwenv.CloseTableCell();

					// input left switch cell
					vwenv.Props = m_inputCtxtProps;
					vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, 1000);
					vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading, (int)FwTextPropVar.ktpvMilliPoint, 2000);
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:101,代码来源:MetaRuleFormulaVc.cs

示例11: AddPreviewPara

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Adds a paragraph (gray line) to the  preview.
		/// </summary>
		/// <param name="vwenv">The vwenv.</param>
		/// <param name="props">Text props, or <c>null</c>.</param>
		/// <param name="fAddSpaceBefore"><c>true</c> to add 6pt space before the paragraph</param>
		/// ------------------------------------------------------------------------------------
		private void AddPreviewPara(IVwEnv vwenv, ITsTextProps props, bool fAddSpaceBefore)
		{
			// (width is -1, meaning "use the rest of the line")

			if (props != null)
				vwenv.Props = props;
			else if (fAddSpaceBefore)
			{
				vwenv.set_IntProperty((int)FwTextPropType.ktptSpaceBefore,
					(int)FwTextPropVar.ktpvMilliPoint, 6000);
			}

			vwenv.set_IntProperty((int)FwTextPropType.ktptRightToLeft,
				(int)FwTextPropVar.ktpvEnum, m_fRtl ? -1 : 0);
			vwenv.OpenParagraph();
			vwenv.AddSimpleRect(Color.LightGray.ToArgb(), -1, kdmpFakeHeight, 0);
			vwenv.CloseParagraph();
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:26,代码来源:FwBulletsPreview.cs

示例12: DisplayAnnotation

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Displays an annotation expanded or contracted
		/// </summary>
		/// <param name="vwenv"></param>
		/// <param name="ann"></param>
		/// <param name="expanded"></param>
		/// ------------------------------------------------------------------------------------
		private void DisplayAnnotation(IVwEnv vwenv, IScrScriptureNote ann, bool expanded)
		{
			#region First row has status, ref, category, & quote
			SetBackgroundColorForNote(ann, vwenv);

			OpenTableRow(vwenv, ann);

			// Display expand box (+/-) in the first cell
			//InsertNoteSeparator(vwenv);
			vwenv.OpenTableCell(1, 1);
			vwenv.AddObj(ann.Hvo, this, (int)NotesFrags.kfrExpansion);
			vwenv.CloseTableCell();

			// Display status in the second cell
			vwenv.OpenTableCell(1, 1);
			vwenv.set_IntProperty((int)FwTextPropType.ktptPadTop,
				(int)FwTextPropVar.ktpvMilliPoint, 1000);

			if (ann.AnnotationType == NoteType.CheckingError)
			{
				// When the annotation is a checking error, we don't want clicking on the status
				// to change the status. Therefore, make the min and max the same.
				vwenv.AddIntPropPic((int)ScrScriptureNoteTags.kflidResolutionStatus,
					this, (int)NotesFrags.kfrStatus, 0, 0);
			}
			else
			{
				vwenv.AddIntPropPic((int)ScrScriptureNoteTags.kflidResolutionStatus,
					this, (int)NotesFrags.kfrStatus, (int)NoteStatus.Open, (int)NoteStatus.Closed);
			}
			vwenv.CloseTableCell();

			// Display reference in the third cell and make it readonly.
			vwenv.OpenTableCell(1, 1);
			vwenv.set_IntProperty((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvDefault, 0);
			vwenv.OpenParagraph();
			vwenv.AddProp((int)CmBaseAnnotationTags.kflidBeginRef, this, (int)NotesFrags.kfrScrRef);
			vwenv.CloseParagraph();
			vwenv.CloseTableCell();

			// Display CONNOT category in the fourth (and possibly fifth and sixth) cell(s)
			vwenv.OpenTableCell(1, expanded ? 3 : 1);
			IStTxtPara quotePara = ann.QuoteOA[0];
			bool fQuoteParaRtoL = IsParaRightToLeft(quotePara);

			// Conc paragraphs don't work well for R-to-L: If the text doesn't fit, it will
			// show the trailing text rather than the leading text.
			if (fQuoteParaRtoL || expanded)
				vwenv.OpenParagraph();
			else
				vwenv.OpenConcPara(0, 0, 0, 0);
			vwenv.AddObjVec((int)ScrScriptureNoteTags.kflidCategories, this,
				(int)NotesFrags.kfrConnotCategory);
			vwenv.CloseParagraph();
			vwenv.CloseTableCell();

			// Display CONNOT category chooser button in the penultimate or last cell
			vwenv.OpenTableCell(1, 1);
			vwenv.set_IntProperty((int)FwTextPropType.ktptPadTop,
				(int)FwTextPropVar.ktpvMilliPoint, 1000);
			vwenv.set_IntProperty((int)FwTextPropType.ktptPadLeading,
				(int)FwTextPropVar.ktpvMilliPoint, 2000);

			vwenv.AddPicture(m_picChooser, -(int)NotesFrags.kfrConnotCategory, 0, 0);
			vwenv.CloseTableCell();

			// If not expanded, display the quote in the last cell
			if (!expanded)
			{
				vwenv.OpenTableCell(1, 1);
				SetupWsAndDirectionForPara(vwenv, quotePara.Hvo);
				if (fQuoteParaRtoL)
					vwenv.OpenParagraph(); // Conc paragraphs don't work well for R-to-L
				else
					vwenv.OpenConcPara(0, 0, 0, 0);
				vwenv.AddString(quotePara.Contents);
				vwenv.CloseParagraph();
				vwenv.CloseTableCell();
			}

			CloseTableRow(vwenv, ann);
			#endregion

			if (!expanded)
				return;

			#region Second through fifth rows
			bool fRegularAnnotation = ann.AnnotationType != NoteType.CheckingError;
			//Second row has quote
			DisplayExpandableAnnotation(vwenv, ann,
				(int)ScrScriptureNoteTags.kflidQuote,
				ann.QuoteOA.Hvo, ann.QuoteOA,
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:101,代码来源:TeNotesVc.cs

示例13: 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)ScrFrags.kfrScripture:
				{
					vwenv.AddLazyVecItems(ScriptureTags.kflidBookAnnotations, this,
						(int)ScrFrags.kfrBook);
					break;
				}
				case (int)ScrFrags.kfrBook:
				{
					vwenv.AddLazyVecItems(ScrBookAnnotationsTags.kflidNotes, 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);

					ICmObject obj = m_cache.ServiceLocator.GetInstance<ICmObjectRepository>().GetObject(hvo);
					vwenv.AddPicture((m_expandTable.ContainsKey(hvo) && m_expandTable[hvo]) ?
						m_picMinus : m_picPlus,	(int)obj.OwningFlid, 0, 0);

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

示例14: Display

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Display a view of the LexEntry (or fragment thereof).
		/// </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)VcFrags.kfragHeadWord:
					// This case should stay in sync with
					// LexEntry.LexemeFormMorphTypeAndHomographStatic
					vwenv.OpenParagraph();
					AddHeadwordWithHomograph(vwenv, hvo);
					vwenv.CloseParagraph();
					break;
				case kfragEntryAndVariant:
					var wfb = m_cache.ServiceLocator.GetInstance<IWfiMorphBundleRepository>().GetObject(hvo);
					//int hvoMf = wfb.MorphRA.Hvo;
					//int hvoLexEntry = m_cache.GetOwnerOfObject(hvoMf);
					// if morphbundle morph (entry) is in a variant relationship to the morph bundle sense
					// display its entry headword and variant type information (LT-4053)
					ILexEntryRef ler;
					var variant = wfb.MorphRA.Owner as ILexEntry;
					if (variant.IsVariantOfSenseOrOwnerEntry(wfb.SenseRA, out ler))
					{
						// build Headword from sense's entry
						vwenv.OpenParagraph();
						vwenv.OpenInnerPile();
						vwenv.AddObj(wfb.SenseRA.EntryID, this, (int)VcFrags.kfragHeadWord);
						vwenv.CloseInnerPile();
						vwenv.OpenInnerPile();
						// now add variant type info
						vwenv.AddObj(ler.Hvo, this, kfragVariantTypes);
						vwenv.CloseInnerPile();
						vwenv.CloseParagraph();
						break;
					}

					// build Headword even though we aren't in a variant relationship.
					vwenv.AddObj(variant.Hvo, this, (int)VcFrags.kfragHeadWord);
					break;
				case kfragVariantTypes:
					ler = m_cache.ServiceLocator.GetInstance<ILexEntryRefRepository>().GetObject(hvo);
					bool fNeedInitialPlus = true;
					vwenv.OpenParagraph();
					foreach (var let in ler.VariantEntryTypesRS.Where(let => let.ClassID == LexEntryTypeTags.kClassId))
					{
						// just concatenate them together separated by comma.
						ITsString tssVariantTypeRevAbbr = let.ReverseAbbr.BestAnalysisAlternative;
						if (tssVariantTypeRevAbbr != null && tssVariantTypeRevAbbr.Length > 0)
						{
							if (fNeedInitialPlus)
								vwenv.AddString(TsStringUtils.MakeTss("+", m_cache.DefaultUserWs));
							else
								vwenv.AddString(TsStringUtils.MakeTss(",", m_cache.DefaultUserWs));
							vwenv.AddString(tssVariantTypeRevAbbr);
							fNeedInitialPlus = false;
						}
					}
					vwenv.CloseParagraph();
					break;
				case kfragFormForm: // form of MoForm
					vwenv.AddStringAltMember(MoFormTags.kflidForm, m_wsActual, this);
					break;
				default:
					base.Display(vwenv, hvo, frag);
					break;
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:73,代码来源:LexEntryUi.cs

示例15: 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 1: // LexEntry
					vwenv.OpenParagraph();
					vwenv.AddObjProp(LexEntryTags.kflidLexemeForm, this, 2);
					vwenv.AddObjVecItems(LexEntryTags.kflidSenses, this, 3);
					vwenv.CloseParagraph();
					break;
				case 2: // MoForm
					vwenv.AddStringAltMember(MoFormTags.kflidForm, m_cache.DefaultVernWs, this);
					NoteItemWidth(vwenv, hvo, MoFormTags.kflidForm, m_cache.DefaultVernWs);
					break;
				case 3: // LexSense
					vwenv.AddStringAltMember(LexSenseTags.kflidGloss, m_cache.DefaultAnalWs, this);
					NoteItemWidth(vwenv, hvo, LexSenseTags.kflidGloss, m_cache.DefaultAnalWs);
					int flid = m_cache.MetaDataCacheAccessor.GetFieldId("LexSense", "LexSenseReferences", false);
					vwenv.AddObjVecItems(flid, this, 4);
					break;
				case 4: // LexReference
					vwenv.AddObjVecItems(LexReferenceTags.kflidTargets, this, 5);
					break;
				case 5: // target of lex reference, which in our test data is made to be a sense
					vwenv.AddStringAltMember(LexSenseTags.kflidGloss, m_cache.DefaultAnalWs, this);
					NoteItemWidth(vwenv, hvo, LexSenseTags.kflidGloss, m_cache.DefaultAnalWs);
					break;
			}
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:38,代码来源:ItemClickedTests.cs


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