Compartir a través de


ExpansionFunction.GetSelection Method

Definition

Gets the span of the selected text in the current view.

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

A TextSpan object containing the span of the selected text.

Remarks

This helper method calls the GetSelection method on the IVsTextView object that is contained in the ExpansionProvider object. If the ExpansionProvider object is not available, the returned TextSpan object has all of its fields set to 0.

Applies to