Share via


LanguagePreferences.EnableFormatSelection Property

Gets or sets whether or not code can be formatted.

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

Syntax

'Declaration
Public Property EnableFormatSelection As Boolean
'Usage
Dim instance As LanguagePreferences 
Dim value As Boolean 

value = instance.EnableFormatSelection

instance.EnableFormatSelection = value
public bool EnableFormatSelection { get; set; }
public:
property bool EnableFormatSelection {
    bool get ();
    void set (bool value);
}
public function get EnableFormatSelection () : boolean 
public function set EnableFormatSelection (value : boolean)

Property Value

Type: System.Boolean
true if the code can be formatted, otherwise false = no automatic formatting.

Remarks

This property applies to both selected and unselected text. The code can be formatted when the user selects the command Format Document or Format Selection. Code can also be formatted as part of code snippet expansion or triggered dynamically as the user types certain characters.

This property is associated with the registry entry EnableFormatSelection.

In the base method, even though this property can be set, the value is not written back to the registry.

.NET Framework Security

See Also

Reference

LanguagePreferences Class

LanguagePreferences Members

Microsoft.VisualStudio.Package Namespace