ProvideLanguageServiceAttribute.RequestStockColors Property

Determines if the language service is using the built-in colorable items as supplied by Visual Studio.

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

Syntax

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

Property Value

Type: System.Boolean
Returns true if the language service uses the built-in colorable items; otherwise, returns false, indicating the language service is supplying custom colorable items.

Remarks

Syntax highlighting (also known as syntax coloring) can greatly enhance the readability of source code. A language service provides values that specify which colorable item to use for each language element and the editor renders the source in the appropriate colors. The language service can use the built-in colorable items supplied by Visual Studio, in which case, the language service should set the RequestStockColors property to true. Otherwise, the language service must supply its own list of colorable items that describes the colors to use for each language element. This is done through the IVsProvideColorableItems interface. The managed package framework (MPF) LanguageService class already supports the IVsProvideColorableItems interface but the corresponding methods must be implemented to do anything useful.

This property is available for any language service implementation.

The default is false, indicating the language service supplies custom colorable items.

The registry entry looks like this:

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

Examples

    [ProvideLanguageService(typeof(MyLanguageService),           // Required
                            MyConstants.languageName,            // Required
                            MyConstants.languageNameResourceID,  // Required
        // Optional language service properties
        RequestStockColors = true,  // use built-in colors only
                           )]

.NET Framework Security

See Also

Reference

ProvideLanguageServiceAttribute Class

Microsoft.VisualStudio.Shell Namespace