VsShellUtilities::GetPackageExtensionPoint<TExtensionPoint, TInterface> Method (Guid, Guid)

 

Creates 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 GUID of the instance.

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

public:
generic<typename TExtensionPoint, typename TInterface>
where TExtensionPoint : ref class
where TInterface : ref class
static TInterface GetPackageExtensionPoint(
	Guid package,
	Guid instance
)

Parameters

package
Type: System::Guid

The package that contains the instance.

instance
Type: System::Guid

The instance identifier for the requested extension point.

Return Value

Type: TInterface

The extension point.

Type Parameters

TExtensionPoint

The type of extension point.

TInterface

The interface.

Exception Condition
ArgumentException

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

InvalidCastException

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

Return to top
Show: