Partager via


ProvideLanguageServiceAttribute.ShowMatchingBrace Property

Determines if the matching language pair is shown in the status bar.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)

Syntax

'Declaration
Public Property ShowMatchingBrace As Boolean
public bool ShowMatchingBrace { get; set; }
public:
property bool ShowMatchingBrace {
    bool get ();
    void set (bool value);
}
member ShowMatchingBrace : bool with get, set
function get ShowMatchingBrace () : boolean 
function set ShowMatchingBrace (value : boolean)

Property Value

Type: Boolean
Returns true if the matching language pair is shown in the status bar; otherwise, returns false.

Remarks

When a matching language pair is highlighted, the matched element can be displayed in the status bar if the ShowMatchingBrace property is set to true. This is not typically useful unless the text before the matching language element is also shown. For example, typing the closing brace '}' for an if statement where the opening brace '{' is on the same line as the if statement could show the entire if statement and opening brace in the status bar. This does mean that the if statement would also be highlighted along with the opening brace. The MatchBraces property must also be set to true for the ShowMatchingBrace property to be used.

This property is specific to the managed package framework (MPF).

The default is true when the corresponding registry entry is accessed through the LanguagePreferences class.

The registry entry looks like this:

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

Examples

    [ProvideLanguageService(typeof(MyLanguageService),           // Required
                            MyConstants.languageName,            // Required
                            MyConstants.languageNameResourceID,  // Required
        // Optional language service properties
        ShowMatchingBrace = true,  // show matching brace in status bar
                           )]

.NET Framework Security

See Also

Reference

ProvideLanguageServiceAttribute Class

Microsoft.VisualStudio.Shell Namespace