Freigeben über


ProvideLanguageServiceAttribute.MatchBraces Property

Determines if the language service supports matching language pairs.

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

Syntax

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

Property Value

Type: Boolean
Returns true if matching language pairs is supported; otherwise, returns false.

Remarks

All computer languages support what can be called language pairs such as '{' and '}', '(' and ')', or '<' and '>'. It is possible to position the caret after an element of a language pair and type Ctrl-] to jump to the corresponding matching pair. A language service indicates its support for matching language pairs in this manner by setting the MatchBraces property to true. To indicate support for matching pairs while typing, the MatchBracesAtCaret property must also be set to true.

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]\
    MatchBraces = reg_dword: 0x00000001

Examples

    [ProvideLanguageService(typeof(MyLanguageService),           // Required
                            MyConstants.languageName,            // Required
                            MyConstants.languageNameResourceID,  // Required
        // Optional language service properties
        MatchBraces = true,  // brace matching is supported
                           )]

.NET Framework Security

See Also

Reference

ProvideLanguageServiceAttribute Class

Microsoft.VisualStudio.Shell Namespace