Share via


ViewFilter.ReformatSelection Method

Handles the FORMATSELECTION command to reformat a selection.

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

Syntax

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

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

Remarks

The base method determines if reformatting is supported, calls the GetSelection method to obtain the TextSpan for the currently selected text (defaulting to the entire document if nothing is selected), creates a new EditArray object to wrap all changes made in a single undo event, then calls the ReformatSpan method on the Source object that was obtained from the CodeWindowManager object in the ViewFilter class constructor. Finally, the base method calls the ApplyEdits method on the EditArray object to commit all the changes.

Typically, you override the ReformatSpan method on the Source class to support reformatting a portion of a document. Since the base method sets up everything for a call to the ReformatSpan method, you do not typically need to override this method unless your version of ReformatSpan has special requirements.

.NET Framework Security

See Also

Reference

ViewFilter Class

ViewFilter Members

Microsoft.VisualStudio.Package Namespace