Partager via


ProvideLanguageServiceAttribute.ShowSmartIndent Property

Determines if the Smart Indenting option is enabled in the Options dialog box.

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

Syntax

'Déclaration
Public Property ShowSmartIndent As Boolean
    Get
    Set
'Utilisation
Dim instance As ProvideLanguageServiceAttribute
Dim value As Boolean

value = instance.ShowSmartIndent

instance.ShowSmartIndent = value
public bool ShowSmartIndent { get; set; }
public:
property bool ShowSmartIndent {
    bool get ();
    void set (bool value);
}
member ShowSmartIndent : bool with get, set
function get ShowSmartIndent () : boolean
function set ShowSmartIndent (value : boolean)

Property Value

Type: System.Boolean
Returns true if the Smart Indenting option is enabled; otherwise, returns false.

Remarks

There are three basic styles of indenting control: None, Block, and Smart. Each controls the behavior of indenting when a new line is typed in the source code. These three options are selectable in the Options dialog box (available under the Tools -> Options menu), typically under the Tabs property page for each language. If the ShowSmartIndent property is set to true, then the indenting option for Smart can be changed. This also indicates that the language service supports smart indenting. Visual Studio can support the None and Block modes without knowing the language being edited, but the Smart indenting option requires knowledge of the language to set the proper indentation levels.

This property is available to any language service implementation.

The default is false indicating the Smart indent option is disabled.

The registry entry looks like this:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\[X.Y]\Languages\Language Services\
  [Language Name]\
    ShowSmartIndent = reg_dword: 0x00000001

Examples

    [ProvideLanguageService(typeof(MyLanguageService),           // Required
                            MyConstants.languageName,            // Required
                            MyConstants.languageNameResourceID,  // Required
        // Optional language service properties
        ShowSmartIndent = true,  // enable indent options
                           )]

.NET Framework Security

See Also

Reference

ProvideLanguageServiceAttribute Class

ProvideLanguageServiceAttribute Members

Microsoft.VisualStudio.Shell Namespace