本文整理汇总了C#中IVwSelection.EndPoint方法的典型用法代码示例。如果您正苦于以下问题:C# IVwSelection.EndPoint方法的具体用法?C# IVwSelection.EndPoint怎么用?C# IVwSelection.EndPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVwSelection
的用法示例。
在下文中一共展示了IVwSelection.EndPoint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectionBeginningGrowToWord
/// <summary>
/// Return a word selection based on the beginning of the current selection.
/// Here the "beginning" of the selection is the offset corresponding to word order,
/// not the selection anchor.
/// </summary>
/// <returns>null if we couldn't handle the selection</returns>
private static IVwSelection SelectionBeginningGrowToWord(IVwSelection sel)
{
if (sel == null)
return null;
var sel2 = sel.EndBeforeAnchor ? sel.EndPoint(true) : sel.EndPoint(false);
if (sel2 == null)
return null;
var sel3 = sel2.GrowToWord();
return sel3;
}
示例2: FindInDictionary
public void FindInDictionary(IOleDbEncap ode, IFwMetaDataCache mdc, IVwOleDbDa oleDbAccess, IVwSelection sel)
{
using (FdoCache cache = new FdoCache(ode, mdc, oleDbAccess))
{
if (sel == null)
return;
IVwSelection sel2 = sel.EndPoint(false);
if (sel2 == null)
return;
IVwSelection sel3 = sel2.GrowToWord();
if (sel3 == null)
return;
ITsString tss;
int ichMin, ichLim, hvo, tag, ws;
bool fAssocPrev;
sel3.TextSelInfo(false, out tss, out ichMin, out fAssocPrev, out hvo, out tag, out ws);
sel3.TextSelInfo(true, out tss, out ichLim, out fAssocPrev, out hvo, out tag, out ws);
// TODO (TimS): need to supply help information (last 2 params)
LexEntryUi.DisplayOrCreateEntry(cache, hvo, tag, ws, ichMin, ichLim, null, null, null, string.Empty);
return;
}
}
示例3: SelectionBeginningGrowToWord
/// <summary>
/// Return a word selection based on the beginning of the current selection.
/// Here the "beginning" of the selection is the offset corresponding to word order,
/// not the selection anchor.
/// </summary>
/// <returns>null if we couldn't handle the selection</returns>
private IVwSelection SelectionBeginningGrowToWord(IVwSelection sel)
{
if (sel == null)
return null;
// REVISIT (EricP) Need to check if Ws is IsRightToLeft?
var sel2 = sel.EndBeforeAnchor ? sel.EndPoint(true) : sel.EndPoint(false);
if (sel2 == null)
return null;
var sel3 = sel2.GrowToWord();
return sel3;
}
示例4: DisplayRelatedEntries
/// ------------------------------------------------------------------------------------
/// <summary>
/// Assuming the selection can be expanded to a word and a corresponding LexEntry can
/// be found, show the related words dialog with the words related to the selected one.
/// </summary>
/// <param name="cache">The cache.</param>
/// <param name="sel">The sel.</param>
/// <param name="owner">The owner.</param>
/// <param name="mediatorIn"></param>
/// <param name="helpProvider"></param>
/// <param name="helpFileKey"></param>
/// ------------------------------------------------------------------------------------
public static void DisplayRelatedEntries(FdoCache cache, IVwSelection sel, IWin32Window owner,
Mediator mediatorIn, IHelpTopicProvider helpProvider, string helpFileKey)
{
if (sel == null)
return;
IVwSelection sel2 = sel.EndPoint(false);
if (sel2 == null)
return;
IVwSelection sel3 = sel2.GrowToWord();
if (sel3 == null)
return;
ITsString tss;
int ichMin, ichLim, hvo, tag, ws;
bool fAssocPrev;
sel3.TextSelInfo(false, out tss, out ichMin, out fAssocPrev, out hvo, out tag, out ws);
sel3.TextSelInfo(true, out tss, out ichLim, out fAssocPrev, out hvo, out tag, out ws);
if (tss.Text == null)
return;
ITsString tssWf = tss.GetSubstring(ichMin, ichLim);
using (LexEntryUi leui = FindEntryForWordform(cache, tssWf))
{
// This doesn't work as well (unless we do a commit) because it may not see current typing.
//LexEntryUi leui = LexEntryUi.FindEntryForWordform(cache, hvo, tag, ichMin, ichLim);
if (leui == null)
{
if (tssWf != null && tssWf.Length > 0)
RelatedWords.ShowNotInDictMessage(owner);
return;
}
int hvoEntry = leui.Object.Hvo;
int[] domains;
int[] lexrels;
IVwCacheDa cdaTemp;
if (!RelatedWords.LoadDomainAndRelationInfo(cache, hvoEntry, out domains, out lexrels, out cdaTemp, owner))
return;
StringTable stOrig;
Mediator mediator;
IVwStylesheet styleSheet;
bool fRestore = EnsureFlexTypeSetup(cache, mediatorIn, out stOrig, out mediator, out styleSheet);
using (RelatedWords rw = new RelatedWords(cache, sel3, hvoEntry, domains, lexrels, cdaTemp, styleSheet, mediatorIn, false))
{
rw.ShowDialog(owner);
}
if (fRestore)
mediator.StringTbl = stOrig;
}
}