本文整理汇总了C#中IVwSelection.ExtendToStringBoundaries方法的典型用法代码示例。如果您正苦于以下问题:C# IVwSelection.ExtendToStringBoundaries方法的具体用法?C# IVwSelection.ExtendToStringBoundaries怎么用?C# IVwSelection.ExtendToStringBoundaries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVwSelection
的用法示例。
在下文中一共展示了IVwSelection.ExtendToStringBoundaries方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectionChanged
/// ------------------------------------------------------------------------------------
/// <summary>
/// Handle TE specific requirements on selection change.
/// </summary>
/// <param name="prootb"></param>
/// <param name="vwselNew"></param>
/// ------------------------------------------------------------------------------------
public override void SelectionChanged(IVwRootBox prootb, IVwSelection vwselNew)
{
CheckDisposed();
// selection change is being done by this routine, don't need to do processing
// second time.
if (m_selectionUpdateInProcess)
return;
// Make sure we don't try to use the old selection (TE-5009).
m_viewSelection = null;
SelectionHelper helper = SelectionHelper.Create(vwselNew, prootb.Site);
UpdateGotoPassageControl(); // update the verse reference to the new selection
SetInformationBarForSelection(); // update title bar with section reference range
if (MainTransVc != null)
ProcessBTSelChange(helper);
bool updatedSelection = false;
int hvoSelObj = 0;
if (helper != null && helper.LevelInfo.Length > 0)
hvoSelObj = helper.LevelInfo[0].hvo;
IGetTeStVc getVc = prootb.Site as IGetTeStVc;
TeStVc vc = null;
if (getVc != null)
vc = getVc.Vc;
if (vc != null && vc.SuppressCommentPromptHvo != hvoSelObj)
{
vc.SuppressCommentPromptHvo = 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.SuppressCommentPromptHvo = 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 (!prootb.IsCompositionInProgress)
vwselNew.ExtendToStringBoundaries();
if (!vwselNew.IsEditable && helper != null)
{
// We somehow got an IP that associates with the non-editable spacer next to the prompt.
// We need to extend in the opposite direction.
helper.AssocPrev = !helper.AssocPrev;
IVwSelection sel = helper.SetSelection(EditedRootBox.Site, false, false);
// Make sure that the new selection is editable before we install it. This keeps us
// from getting here again and again (recursively). (TE-8763)
if (sel.IsEditable)
sel.Install();
return; // We have already been called again as the new selection is installed.
}
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 ||
(m_viewType & TeViewType.NotesDataEntryView) != 0 || helper == null)
{
// This makes sure the writing system and styles combos get updated.
base.SelectionChanged(prootb, 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(vwselNew, prootb, ref updatedSelection);
// 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.SelectionChanged(prootb, vwselNew);
// If we changed the selection in this method we want to set the viewSelection to
// null so that the next time it is gotten it will have the correct selection.
if (updatedSelection)
m_viewSelection = null;
// 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;
//.........这里部分代码省略.........
示例2: HandleSelectionChange
protected override void HandleSelectionChange(IVwRootBox rootb, IVwSelection vwselNew)
{
CheckDisposed();
base.HandleSelectionChange(rootb, vwselNew);
// JohnT: it's remotely possible that the base, in calling commit, made this
// selection no longer useable.
if (!vwselNew.IsValid)
return;
IWfiWordform wordform;
if (!GetSelectedWordform(vwselNew, out wordform))
wordform = null;
m_mediator.PropertyTable.SetProperty("TextSelectedWord", wordform);
m_mediator.PropertyTable.SetPropertyPersistence("TextSelectedWord", false);
SelectionHelper helper = SelectionHelper.Create(vwselNew, this);
if (helper != null && helper.GetTextPropId(SelectionHelper.SelLimitType.Anchor) == RawTextVc.kTagUserPrompt)
{
vwselNew.ExtendToStringBoundaries();
EditingHelper.SetKeyboardForSelection(vwselNew);
}
}
示例3: 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);
//.........这里部分代码省略.........
示例4: CreateEditControl
private static SimpleRootSiteEditControl CreateEditControl(IChildControlNavigation rawElementProviderRoot,
IVwRootBox rootBox, IVwSelection selection)
{
if (!selection.IsRange)
selection.ExtendToStringBoundaries();
return new SimpleRootSiteEditControl(rawElementProviderRoot,
rootBox.Site as SimpleRootSite, selection, "");
}
示例5: HandleSelectionChange
protected override void HandleSelectionChange(IVwRootBox rootb, IVwSelection vwselNew)
{
ICmObject selected = SelectedObject;
int selectedHvo = 0;
if (selected != null)
selectedHvo = selected.Hvo;
if (selectedHvo != m_prevSelectedHvo)
{
if (DeleteItem())
{
m_prevSelectedHvo = selectedHvo;
SelectedObject = selected;
}
else
{
m_prevSelectedHvo = selectedHvo;
vwselNew.ExtendToStringBoundaries();
}
}
}
示例6: SelectionChanged
public override void SelectionChanged(IVwRootBox rootb, IVwSelection vwselNew)
{
CheckDisposed();
base.SelectionChanged(rootb, vwselNew);
// JohnT: it's remotely possible that the base, in calling commit, made this
// selection no longer useable.
if (!vwselNew.IsValid)
return;
SelectionHelper helper = SelectionHelper.Create(vwselNew, this);
if (helper != null && helper.GetTextPropId(SelectionHelper.SelLimitType.Anchor) == RawTextVc.kTagUserPrompt)
{
vwselNew.ExtendToStringBoundaries();
EditingHelper.SetKeyboardForSelection(vwselNew);
}
}