ProvideLanguageEditorOptionPageAttribute Class


Provide a general method for setting a language service's editor tool option page.

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


[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = true, 
	Inherited = true)]
public sealed class ProvideLanguageEditorOptionPageAttribute : ProvideOptionDialogPageAttribute

System_CAPS_pubmethodProvideLanguageEditorOptionPageAttribute(Type, String, String, String, String, Int32)

Instantiates a new instance of ProvideLanguageEditorOptionPageAttribute.

System_CAPS_pubmethodProvideLanguageEditorOptionPageAttribute(Type, String, String, String, String, String)

Instantiates a new instance of ProvideLanguageEditorOptionPageAttribute.

System_CAPS_pubmethodProvideLanguageEditorOptionPageAttribute(Type, String, String, String, String, String[])

Instantiates a new instance of ProvideLanguageEditorOptionPageAttribute.


Gets the keywords.


Gets the name of the language.


Gets the GUID of the option page.


Gets the name resource ID of the page.(Inherited from ProvideOptionDialogPageAttribute.)


Gets the type of the page.(Inherited from ProvideOptionDialogPageAttribute.)


Gets the current instance of this attribute.(Inherited from RegistrationAttribute.)


(Inherited from Attribute.)


(Inherited from Attribute.)


(Inherited from Object.)


(Inherited from Attribute.)


(Inherited from Attribute.)


Creates all the registry keys and entries as specified by the class constructor.(Overrides RegistrationAttribute.Register(RegistrationAttribute.RegistrationContext).)


(Inherited from Object.)


Removes all of the registry keys and entries.(Overrides RegistrationAttribute.Unregister(RegistrationAttribute.RegistrationContext).)

This information is stored in the registry key <RegistrationRoot>\Languages\Language Services\[language]\EditorToolsOptions, where [language] is the name of the language.

Under EditorToolsOptions is a tree of pages and sub-pages that can nest any number of levels. These pages correspond to the options pages displayed in the Visual Studio Tools Options for editors (where a tree of option pages is displayed under the language name, each page containing appropriate options).

Each key in this option page list contains a resource id or literal string containing the localized name of the page. This is what is actually shown in the Tools Options dialog. In addition, it also contains a package GUID and optionally a GUID of an option page.

If there is no option page GUID, then the key is considered to be a node in the tree of options and has no associated page. Otherwise, the key is a leaf in the tree, and its option page will be shown.

There can be multiple instances of this attribute, and each instance specifies a node or a property page. The attributes can appear in any order. If the property page GUID is specified then a property page is registered, otherwise it is a node that is registered.

The following user-defined attributes are used for language services:




Registers the language service with Visual Studio and specifies which features are supported.


Associates a file extension with the language service.


Specifies a property node or page for the Options dialog box specific to the language service.


Specifies location information to support code snippets in the language service.


Registers a language service as a Visual Studio service. All services supplied in managed code use this attribute.

Notes to Implementers:

This attribute class cannot be inherited from so there is nothing to implement.

Notes to Callers:

This attribute class is typically applied to your primary VSPackage class, although it can appear on any class. This attribute class can appear multiple times and in any order, once for each property page and node in the property page tree.

This example shows how this user-defined attribute is used to register two property pages ("General" and "Indent") and a property page node ("Formatting") that contains the "Indent" property page. Note how the second parameter to the constructor specifies the position in the registry relative to the node.


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.

using Microsoft.VisualStudio.Shell;

namespace MyLanguagePackage
    internal class MyConstants
        public const string languageName                = "MyLanguage";
        public const string formattingNodeResIDAsString = "#108";
        public const string generalPageResIDAsString    = "#109";
        public const string indentPageResIDAsString     = "#110";

                                     "General",  // property page
        // Optional language service properties
        OptionPageGuid = "{12434534-cecd-48e7-a866-45cad2e8b169}"
                                     "Formatting",  // property node
                                     @"Formatting\Indent",  // property page
        // Optional language service properties
        OptionPageGuid = "{12434556-cecd-48e7-a866-45cad2e8b169}"

    class MyLanguagePackage

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top