Share via


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.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)

Syntax

'Declaration
Public Sub New ( _
    languageService As Type, _
    extension As String _
)
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: Type

    [in] The type of the language service class.

  • extension
    Type: 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