DesignSurfaceExtension Class

 

The base class for any object provided by a VSPackage to be called by the Visual Studio environment upon designer creation to customize or extend services and metadata provided by any implementation of DesignSurface.

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

System.Object
  Microsoft.VisualStudio.Shell.Design.DesignSurfaceExtension

[ComVisibleAttribute(true)]
public abstract class DesignSurfaceExtension : IDisposable

NameDescription
System_CAPS_protmethodDesignSurfaceExtension()

Create a new instance of the DesignSurfaceExtension class.

NameDescription
System_CAPS_protpropertySurface

Gets the design surface this extension was initialized with.

NameDescription
System_CAPS_pubmethodDispose()

Disposes this object and its resources.

System_CAPS_protmethodDispose(Boolean)

Disposes this object and its resources.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

Destroys the object.(Overrides Object.Finalize().)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodInitialize(DesignSurface)

Initializes the design surface extension.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodOnComponentCreated(IComponent)

This method is called when a new component is created but before that component is added to the designer.

System_CAPS_pubmethodOnDesignerCreated(IComponent, IDesigner, Boolean)

This method is called when a new designer is created.

System_CAPS_pubmethodOnDesignerCreated(IDesigner)

Obsolete.This method is called when a new designer is created.

System_CAPS_pubmethodToString()

(Inherited from Object.)

DesignSurfaceExtension object must be registered by applying the following Attribute instances applied to a VSPackage's Package implementation:

  • DesignSurfaceExtensionAttribute to notify the Visual Studio environment that the DesignSurfaceExtension implementation as providing customization of the design surface at designer load time.

  • ProvideObjectAttribute to indicate that the VSPackage provides instances of the DesignSurfaceExtension object.

  • ProvideServiceAttribute to indicate that the DesignSurfaceExtension implementation is provided by the VSPackage as a Visual Studio SDK service.

An application already loaded by the Visual Studio environment can provide dynamic modification of a designer surface's services or metadata at surface or component creation by handling DesignerCreated event.

However, as VSPackages are demand loaded, a package may not have been loaded by the Visual Studio environment prior to the loading of a design surface, and thus would not be able to subscribe to DesignerCreated event.

To handle this problem, whenever any design surfaces or designer component is created, the Visual Studio environment creates instances of registered DesignSurfaceExtension and applies them to the created surface or component.

This guarantees that a VSPackage's designer start up modifications are correctly executed and the VSPackage itself is loaded as needed.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: