Udostępnij za pośrednictwem


ProvideLanguageServiceAttribute.ShowSmartIndent Property

Definition

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

public:
 property bool ShowSmartIndent { bool get(); void set(bool value); };
public:
 property bool ShowSmartIndent { bool get(); void set(bool value); };
public bool ShowSmartIndent { get; set; }
member this.ShowSmartIndent : bool with get, set
Public Property ShowSmartIndent As Boolean

Property Value

Returns true if the Smart Indenting option is enabled; otherwise, returns false.

Examples

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

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  

Applies to