共用方式為


ProvideLanguageExtensionAttribute Constructor (Type, String)

Initializes a new instance of the ProvideLanguageExtensionAttribute attribute, using the type of your language service class.

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

Syntax

'宣告
Public Sub New ( _
    languageService As Type, _
    extension As String _
)
public ProvideLanguageExtensionAttribute(
    Type languageService,
    string extension
)

Parameters

  • languageService
    Type: System.Type
    [in] The type of the language service class.
  • extension
    Type: System.String
    [in] A string containing the file extension to associate with the language service.

Remarks

Use the typeof (C# Reference) operator to get the type of your language class. The following example shows how this operator is used.

The file extension should always have the leading period.

Examples

using Microsoft.VisualStudio.Shell;

namespace MyLanguagePackage
{
    [ProvideLanguageExtension(typeof(MyLanguageService), ".myext")]
    public class MyLanguagePackage : Package
    {
    }
}

.NET Framework Security

See Also

Reference

ProvideLanguageExtensionAttribute Class

ProvideLanguageExtensionAttribute Overload

Microsoft.VisualStudio.Shell Namespace