다음을 통해 공유


ProvideLanguageServiceAttribute.EnableLineNumbers Property

Determines if the Line numbers option can be selected in the Options dialog box.

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

‘선언
Public Property EnableLineNumbers As Boolean
    Get
    Set
‘사용 방법
Dim instance As ProvideLanguageServiceAttribute
Dim value As Boolean

value = instance.EnableLineNumbers

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

Property Value

Type: System.Boolean
Returns true if the Line numbers option is enabled for use; otherwise, returns false.

Remarks

Visual Studio can display line numbers for any source file, helping users find particular lines of source. This ability is controlled from the Options dialog box (available from the Tools -> Options menu) with the option Line numbers. If a language service cannot support line numbers for some reason, then the EnableLineNumbers property should be set to false, thereby disabling the Line numbers option.

This property is available to any language service implementation.

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

Examples

    [ProvideLanguageService(typeof(MyLanguageService),           // Required
                            MyConstants.languageName,            // Required
                            MyConstants.languageNameResourceID,  // Required
        // Optional language service properties
        EnableLineNumbers = true,  // line numbers are supported
                           )]

.NET Framework Security

See Also

Reference

ProvideLanguageServiceAttribute Class

ProvideLanguageServiceAttribute Members

Microsoft.VisualStudio.Shell Namespace