Share via


ViewFilter.GetSelection Method

Returns the extent of the currently selected text.

Namespace:  Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)

Syntax

'Declaration
Public Function GetSelection As TextSpan
'Usage
Dim instance As ViewFilter 
Dim returnValue As TextSpan 

returnValue = instance.GetSelection()
public TextSpan GetSelection()
public:
TextSpan GetSelection()
public function GetSelection() : TextSpan

Return Value

Type: Microsoft.VisualStudio.TextManager.Interop.TextSpan
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.

.NET Framework Security

See Also

Reference

ViewFilter Class

ViewFilter Members

Microsoft.VisualStudio.Package Namespace