Share via


ExpansionFunction.GetSelection Method

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

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 ExpansionFunction 
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
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.

.NET Framework Security

See Also

Reference

ExpansionFunction Class

ExpansionFunction Members

Microsoft.VisualStudio.Package Namespace