ProvideLanguageExtensionAttribute Constructor (Type, String)

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

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

Syntax

声明
Public Sub New ( _
    languageService As Type, _
    extension As String _
)
用法
Dim languageService As Type
Dim extension As String

Dim instance As New ProvideLanguageExtensionAttribute(languageService, _
    extension)
public ProvideLanguageExtensionAttribute(
    Type languageService,
    string extension
)
public:
ProvideLanguageExtensionAttribute(
    Type^ languageService, 
    String^ extension
)
new : 
        languageService:Type * 
        extension:string -> ProvideLanguageExtensionAttribute
public function ProvideLanguageExtensionAttribute(
    languageService : Type, 
    extension : String
)

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 Members

ProvideLanguageExtensionAttribute Overload

Microsoft.VisualStudio.Shell Namespace