Share via


ProvideLanguageExtensionAttribute Constructors

Definition

Initializes a new instance of the ProvideLanguageExtensionAttribute attribute.

Overloads

ProvideLanguageExtensionAttribute(String, String)

Initializes a new instance of the ProvideLanguageExtensionAttribute attribute, using the specified language service GUID.

ProvideLanguageExtensionAttribute(Type, String)

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

Remarks

These constructors are used to specify the language service GUID and the file extension.

ProvideLanguageExtensionAttribute(String, String)

Initializes a new instance of the ProvideLanguageExtensionAttribute attribute, using the specified language service GUID.

public:
 ProvideLanguageExtensionAttribute(System::String ^ languageServiceGuid, System::String ^ extension);
public:
 ProvideLanguageExtensionAttribute(Platform::String ^ languageServiceGuid, Platform::String ^ extension);
 ProvideLanguageExtensionAttribute(std::wstring const & languageServiceGuid, std::wstring const & extension);
public ProvideLanguageExtensionAttribute (string languageServiceGuid, string extension);
new Microsoft.VisualStudio.Shell.ProvideLanguageExtensionAttribute : string * string -> Microsoft.VisualStudio.Shell.ProvideLanguageExtensionAttribute
Public Sub New (languageServiceGuid As String, extension As String)

Parameters

languageServiceGuid
String

[in] A string containing the GUID of the language service.

extension
String

[in] A string containing the file extension to associate with the language service.

Examples

using Microsoft.VisualStudio.Shell;  

namespace MyLanguagePackage  
{  
    [ProvideLanguageExtension("{B614A40A-80D9-4FAC-A6AD-FC2868FFF7CD}", ".myext")]  
    public class MyLanguagePackage : Package  
    {  
    }  
}  

Remarks

The format of the GUID string is "{B614A40A-80D9-4FAC-A6AD-FC2868FFF7CD}", substituting your own language service's GUID value for the one shown.

The file extension should always have the leading period.

Applies to

ProvideLanguageExtensionAttribute(Type, String)

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

public:
 ProvideLanguageExtensionAttribute(Type ^ languageService, System::String ^ extension);
public:
 ProvideLanguageExtensionAttribute(Platform::Type ^ languageService, Platform::String ^ extension);
public ProvideLanguageExtensionAttribute (Type languageService, string extension);
new Microsoft.VisualStudio.Shell.ProvideLanguageExtensionAttribute : Type * string -> Microsoft.VisualStudio.Shell.ProvideLanguageExtensionAttribute
Public Sub New (languageService As Type, extension As String)

Parameters

languageService
Type

[in] The type of the language service class.

extension
String

[in] A string containing the file extension to associate with the language service.

Examples

using Microsoft.VisualStudio.Shell;  

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

Remarks

Use the typeof 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.

Applies to