共用方式為


VsShellUtilities.GetPackageExtensionPoint<TExtensionPoint,TInterface> Method

Definition

Create an instance of an extension point from the given package. This is analagous to finding an "Export" of a given type (T) with instance metadata given by the "instance" Guid.

public:
generic <typename TExtensionPoint, typename TInterface>
 where TExtensionPoint : class where TInterface : class static TInterface GetPackageExtensionPoint(Guid package, Guid instance);
public static TInterface GetPackageExtensionPoint<TExtensionPoint,TInterface> (Guid package, Guid instance) where TExtensionPoint : class where TInterface : class;
static member GetPackageExtensionPoint : Guid * Guid -> 'Interface (requires 'ExtensionPoint : null and 'Interface : null)
Public Shared Function GetPackageExtensionPoint(Of TExtensionPoint As Class, TInterface As Class) (package As Guid, instance As Guid) As TInterface
Public Function GetPackageExtensionPoint(Of TExtensionPoint As Class, TInterface As Class) (package As Guid, instance As Guid) As TInterface

Type Parameters

TExtensionPoint

Type of extension point

TInterface

Interface requested

Parameters

package
Guid

Package containing the instance

instance
Guid

Instance identifier for the requested extension point

Returns

TInterface

The extension point

Exceptions

The extension point is not recognized by the package, or the package does not use attributes to declare any class implementing the extension.

The package does not implement the IVsPackageExtensionProvider interface, or the extension provider was created but it does not implement the TInterface interface.

Applies to