共用方式為


ExtensionPointPackage.CreateExtensionPointProvider<TAttribute, TInterface> Method

Creates the extension provider declared with the attribute TAttribute on the package, implementing an extension point of type TInterface.

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

Syntax

'宣告
Protected Function CreateExtensionPointProvider(Of TAttribute As ExtensionPointRegistrationAttribute, TInterface As Class) ( _
    provider As Guid _
) As TInterface
protected TInterface CreateExtensionPointProvider<TAttribute, TInterface>(
    Guid provider
)
where TAttribute : ExtensionPointRegistrationAttribute
where TInterface : class

Type Parameters

  • TAttribute
    The attribute of the package.
  • TInterface
    The extension point.

Parameters

  • provider
    Type: System.Guid
    GUID of the requested extension provider.

Return Value

Type: TInterface
The requested extension provider.

Exceptions

Exception Condition
ArgumentException

The requested provider was not found.

InvalidCastException

The requested provider does not implement the TInterface interface.

.NET Framework Security

See Also

Reference

ExtensionPointPackage Class

Microsoft.VisualStudio.Shell Namespace