VsShellUtilities::TryGetPackageExtensionPoint<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 the instance metadata given by the "instance" Guid.

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 TryGetPackageExtensionPoint(
	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 requested.

Exception Condition
ArgumentException

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

InvalidCastException

The package does not implement the T:Microsoft.VisualStudio.Shell.Interop.VsPackageExtensionProvider interface, or the extension provider was created but it does not implement the TInterface interface.

Return to top
Show: