Share via


ViewFilter.CommentSelection Method

Handles the COMMENT_BLOCK command to comment out the current selection in the view.

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

Syntax

'Declaration
Public Overridable Sub CommentSelection
'Usage
Dim instance As ViewFilter

instance.CommentSelection()
public virtual void CommentSelection()
public:
virtual void CommentSelection()
public function CommentSelection()

Remarks

This method obtains the current selection from the view and calls the Source object to comment out the selection.

The base method obtains the current selection by calling the GetSelection method, then calls the CommentSpan method on the Source object, and finally calls the SetSelection method on the IVsTextView object passed to the ViewFilter class constructor to select the newly commented block.

In the default managed package framework implementation of the language service classes, this method is called from the HandlePreExec method.

.NET Framework Security

See Also

Reference

ViewFilter Class

ViewFilter Members

Microsoft.VisualStudio.Package Namespace