次の方法で共有


ViewFilter.GetSelection Method

Definition

Returns the current selection, adjusted to become a positive text span

public:
 Microsoft::VisualStudio::TextManager::Interop::TextSpan GetSelection();
public:
 Microsoft::VisualStudio::TextManager::Interop::TextSpan GetSelection();
Microsoft::VisualStudio::TextManager::Interop::TextSpan GetSelection();
public Microsoft.VisualStudio.TextManager.Interop.TextSpan GetSelection ();
member this.GetSelection : unit -> Microsoft.VisualStudio.TextManager.Interop.TextSpan
Public Function GetSelection () As TextSpan

Returns

Returns a TextSpan object specifying the selected span of text.

Remarks

This method calls the GetSelectionSpan method on the IVsTextView object passed to the ViewFilter class constructor. The resulting TextSpan object contains the span of the selected text or the location of the caret if no text is selected.

Applies to