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


C# IVwSelection.GrowToWord方法代码示例

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


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

示例1: SelectionChanged

		/// <summary>
		/// Handle a selection change by growing it to a word (unless the new selection IS
		/// the one we're growing to a word).
		/// </summary>
		/// <param name="prootb"></param>
		/// <param name="vwselNew"></param>
		public override void SelectionChanged(IVwRootBox prootb, IVwSelection vwselNew)
		{
			CheckDisposed();

			base.SelectionChanged (prootb, vwselNew);
			if (!m_fInSelChange)
			{
				m_fInSelChange = true;
				try
				{
					if (!vwselNew.IsRange)
					{
						vwselNew.GrowToWord().Install();
					}
				}
				finally
				{
					m_fInSelChange = false;
				}
			}
			if (SelChanged != null)
				SelChanged(this, new EventArgs());
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:29,代码来源:RelatedWords.cs

示例2: DoContextMenu

		/// <summary>
		/// Handle a right mouse up, invoking an appropriate context menu.
		/// </summary>
		/// <param name="pt"></param>
		/// <param name="rcSrcRoot"></param>
		/// <param name="rcDstRoot"></param>
		/// <returns></returns>
		protected override bool DoContextMenu(IVwSelection sel, Point pt, Rectangle rcSrcRoot, Rectangle rcDstRoot)
		{
			// Allow base method to handle spell check problems, if any.
			if (base.DoContextMenu(sel, pt, rcSrcRoot, rcDstRoot))
				return true;

			XWindow mainWind = this.ParentForm as XWindow;
			if (mainWind == null || sel == null)
				return false;
			ITsString tssWord;

			sel.GrowToWord().GetSelectionString(out tssWord, " ");
			TemporaryColleagueParameter tempColleague = null;
			if (tssWord != null && !string.IsNullOrEmpty(tssWord.Text))
			{
				// We can have a WfiWordformUi as an additional colleague to handle more menu items.
				// The temporaray colleague handles adding and removing it.
				int form = WfiWordform.FindOrCreateWordform(Cache, tssWord, true);

				CmObjectUi ui = CmObjectUi.MakeUi(Cache, form);
				ui.Mediator = m_mediator;
				tempColleague = new TemporaryColleagueParameter(m_mediator, ui, false);
			}

			mainWind.ShowContextMenu("mnuIText-RawText", new Point(Cursor.Position.X, Cursor.Position.Y),
				tempColleague, null);
			return true;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:35,代码来源:RawTextPane.cs


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