Examples

This example shows how this user-defined attribute is used to register a language service that supports IntelliSense operations, brace matching, asynchronous (background) parsing, and custom colorable items.

Note

Visual C# allows for a shorthand form of a user-defined attribute by dropping the "Attribute" part of the name. This shorthand form is used in this and all other examples throughout this class.

Remarks

This user-defined attribute (which is specific to Visual C#) is used to provide information necessary to register a language service with Visual Studio. The values specified by this attribute are stored as metadata in the assembly. This metadata is later used by a program such as regpkg.exe (part of the VSIP SDK) to create the corresponding registry keys and entries that tell Visual Studio about the language service.

Where [X.Y] is the version of Visual Studio, for example, 8.0Exp, and [language name] is the name of the language (as specified in the second parameter to the ProvideLanguageServiceAttribute class constructor).

Note

Each property specifies the exact registry entry it affects so those entries are not shown in the above example. Those additional entries appear at the same level as the three entries shown.

The class constructor specifies the minimum required parameters. A user-defined attribute class also supports optional named parameters. These named parameters are specified in the constructor's parameter list after the required parameters. All of the properties on this class that support both get and set operators can be specified as a named parameter. The Example shows how named parameters are used.

Note

Some of the named parameters are specific to the managed package framework (MPF) and these are noted in each property description.