本文整理汇总了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());
}
示例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;
}