다음을 통해 공유


ViewFilter.GetSelection Method

Returns the extent of the currently selected text.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)

Syntax

‘선언
Public Function GetSelection As TextSpan
‘사용 방법
Dim instance As ViewFilter
Dim returnValue As TextSpan

returnValue = instance.GetSelection()
public TextSpan GetSelection()
public:
TextSpan GetSelection()
member GetSelection : unit -> TextSpan 
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