DesignSurfaceExtensionAttribute Constructor (Type^)

 

Creates a new instance of the DesignSurfaceExtensionAttribute class specifying a given object as providing a VSPackage's implementation of DesignSurfaceExtension.

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

public:
DesignSurfaceExtensionAttribute(
	Type^ extensionType
)

Parameters

extensionType
Type: System::Type^

The Type of the object providing an implementation of DesignSurfaceExtension to customize design surfaces.

Exception Condition
ArgumentNullException

extensionType is null.

ArgumentException

extensionType does not derive from DesignSurfaceExtension.

Whenever the VSPackage makes use of a design surface, an instance of extensionType object will be used to modify that surface's behavior.

The Type used to construct the DesignSurfaceExtensionAttribute must also be registered as an object provided by the VSPackage, with ProvideObjectAttribute and a service, with ProvideServiceAttribute.

The example below declares that the VSPackage CustomDesigner, provided the class CustomSurfaceExt to customize the design surface it uses.

[ProvideServiceAttribute(typeof(CustomSurfaceExt))]
[ProvideObjectAttribute(typeof(CustomSurfaceExt))]
[DesignSurfaceExtension(typeof(CustomSurfaceExt))] 
class CustomDesigner : Package 
Return to top
Show: