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


C# IVwSelection.GetSelectionString方法代码示例

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


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

示例1: InterlinClipboardHelper

			internal InterlinClipboardHelper(IVwSelection vwsel, InterlinDocChild site, FdoCache cache)
			{
				// Get the string and split it into its individual lines.
				vwsel.GetSelectionString(out m_tss, "\t");
				m_rgtssPieces = StringUtils.Split(m_tss, new string[] { Environment.NewLine }, StringSplitOptions.None);
				m_choices = site.LineChoices;
				m_fHaveMorphemeLevel = m_choices.HaveMorphemeLevel;
				if (m_fHaveMorphemeLevel)
					m_cMorphLines = m_idxChoiceLastMorpheme - m_idxChoiceFirstMorpheme + 1;
				m_idxChoiceFirstMorpheme = m_choices.FirstMorphemeIndex;
				m_idxChoiceLastMorpheme = m_choices.LastMorphemeIndex;
				m_idxChoiceFirstFreeform = m_choices.FirstFreeformIndex;
				m_cChoices = m_choices.Count;
				m_cInterlinearLines = m_choices.FirstFreeformIndex;
				// Get the labels for the lines in m_choices.
				m_rgsLabel = new string[m_cInterlinearLines];
				for (int i = 0; i < m_rgsLabel.Length; ++i)
					m_rgsLabel[i] = m_choices.LabelFor(m_choices[i].Flid);
				bool fTaggingView = site is InterlinTaggingChild;
				if (site is InterlinTaggingChild)
				{
					m_fHaveTagging = true;
					m_idxChoiceTaggingLine = m_idxChoiceFirstFreeform;
					++m_idxChoiceFirstFreeform;
					++m_cChoices;
				}
				else
				{
					m_fHaveTagging = false;
					m_idxChoiceTaggingLine = -1;
				}
				m_cache = cache;
			}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:33,代码来源:InterlinDocView.cs

示例2: HandleSelectionChange

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Handle TE specific requirements on selection change.
		/// </summary>
		/// <param name="rootb">The rootbox whose selection changed</param>
		/// <param name="vwselNew">The new selection</param>
		/// ------------------------------------------------------------------------------------
		public override void HandleSelectionChange(IVwRootBox rootb, IVwSelection vwselNew)
		{
			CheckDisposed();

			// selection change is being done by this routine, don't need to do processing
			// second time.
			if (m_selectionUpdateInProcess)
				return;

			SelectionHelper helper = CurrentSelection;

			UpdateGotoPassageControl(); // update the verse reference to the new selection
			SetInformationBarForSelection(); // update title bar with section reference range

			if (VernacularDraftVc != null)
				ProcessBTSelChange(helper);

			int hvoSelObj = 0;
			if (helper != null && helper.LevelInfo.Length > 0)
				hvoSelObj = helper.LevelInfo[0].hvo;

			ITeDraftView getVc = rootb.Site as ITeDraftView;
			TeStVc vc = (getVc != null) ? getVc.Vc : null;

			if (vc != null && vc.HvoOfSegmentWhoseBtPromptIsToBeSupressed != hvoSelObj)
			{
				vc.HvoOfSegmentWhoseBtPromptIsToBeSupressed = 0;
				// Enhance JohnT: do a Propchanged (possibly delayed until idle) on hvo.Comment to make the prompt reappear.
			}

			// If the selection is in a user prompt then extend the selection to cover the
			// entire prompt.
			if (IsSelectionInPrompt(helper))
			{
				if (vc != null)
					vc.HvoOfSegmentWhoseBtPromptIsToBeSupressed = hvoSelObj;

				// If we're not really showing the prompt, but just an incomplete composition that was typed
				// over it, we do NOT want to select all of it all the time! (TE-8267).
				if (!rootb.IsCompositionInProgress)
					vwselNew.ExtendToStringBoundaries();
				SetKeyboardForSelection(vwselNew);
			}

			// This isn't ideal but it's one of the better of several bad options for dealing
			// with simplifying the selection changes in footnote views.
			if ((m_viewType & TeViewType.FootnoteView) != 0 || helper == null)
			{
				// This makes sure the writing system and styles combos get updated.
				base.HandleSelectionChange(rootb, vwselNew);
				return;
			}

			// If selection is IP, don't allow it to be associated with a verse number run.
			bool fRangeSelection = vwselNew.IsRange;
			if (!fRangeSelection)
				PreventIPAssociationWithVerseRun(rootb);

			// Need to do this at end since selection may be changed by this method.
			// Doing this at top can also cause value of style in StylesComboBox to flash
			base.HandleSelectionChange(rootb, vwselNew);

			// Make sure the selection is in a valid Scripture element.
			int tagSelection;
			int hvoSelection;
			if (!vwselNew.IsValid || !GetSelectedScrElement(out tagSelection, out hvoSelection))
			{
				m_sPrevSelectedText = null;
				return;
			}

			// Determine whether or not the selection changed but is in a different reference.
			bool fInSameRef = (m_oldReference == CurrentStartRef);
			if (fInSameRef && !fRangeSelection)
			{
				m_sPrevSelectedText = null;
				SyncToScrLocation(true);
				return;
			}

			ScrReference curStartRef = CurrentStartRef;
			if (curStartRef.Chapter == 0)
				curStartRef.Chapter = 1;

			m_oldReference = CurrentStartRef;

			string selectedText = null;
			if (fRangeSelection)
			{
				try
				{
					ITsString tssSelectedText;
					vwselNew.GetSelectionString(out tssSelectedText, string.Empty);
//.........这里部分代码省略.........
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:101,代码来源:TeEditingHelper.cs


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