Partager via


ProvideLanguageServiceAttribute.EnableCommenting Property

Determines whether the language service can comment and uncomment source code using a single command.

Namespace:  Microsoft.VisualStudio.Shell
Assemblies:   Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
  Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)
  Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)

Syntax

'Déclaration
Public Property EnableCommenting As Boolean
    Get
    Set
'Utilisation
Dim instance As ProvideLanguageServiceAttribute
Dim value As Boolean

value = instance.EnableCommenting

instance.EnableCommenting = value
public bool EnableCommenting { get; set; }
public:
property bool EnableCommenting {
    bool get ();
    void set (bool value);
}
member EnableCommenting : bool with get, set
function get EnableCommenting () : boolean
function set EnableCommenting (value : boolean)

Property Value

Type: System.Boolean
Returns true if commenting is supported; otherwise, returns false.

Remarks

Visual Studio supplies an advanced editing option that can comment out an entire section of source code with a single command (Edit -> Advanced -> Comment Selection menu command). There is also a command to uncomment a section of code. If this feature is supported by the language service, then the EnableCommenting property should 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]\
    EnableCommenting = reg_dword: 0x00000001

Examples

    [ProvideLanguageService(typeof(MyLanguageService),           // Required
                            MyConstants.languageName,            // Required
                            MyConstants.languageNameResourceID,  // Required
        // Optional language service properties
        EnableCommenting = true,  // Commenting/uncommenting is supported
                           )]

.NET Framework Security

See Also

Reference

ProvideLanguageServiceAttribute Class

ProvideLanguageServiceAttribute Members

Microsoft.VisualStudio.Shell Namespace