Compartilhar via


ViewFilter.CanReformat Method

Definition

This method returns true if the FormatDocument and FormatSelection commands are to be enabled. Default returns false if debugging, otherwise it returns the result for Preferences.EnableFormatSelection.

public:
 virtual bool CanReformat();
public:
 virtual bool CanReformat();
 virtual bool CanReformat();
public virtual bool CanReformat ();
abstract member CanReformat : unit -> bool
override this.CanReformat : unit -> bool
Public Overridable Function CanReformat () As Boolean

Returns

true if the source can be reformatted, otherwise false: either the debugger is active or the language service does not support reformatting.

Remarks

A reformat can occur if the user explicitly selects Format Selection of Format Document, or it can occur implicitly as the result of entering a character that triggers an auto-format action (for example, entering a "}" could cause all of the text between the "}" and the opening "{" to be indented properly).

The base method determines if a debugger is active (returning false if it is active) and if not, returns the value from the EnableFormatSelection property.

Applies to