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)

Syntax

‘선언
<ComVisibleAttribute(True)> _
Public MustInherit Class DesignSurfaceExtension _
    Implements IDisposable
‘사용 방법
Dim instance As DesignSurfaceExtension
[ComVisibleAttribute(true)]
public abstract class DesignSurfaceExtension : IDisposable
[ComVisibleAttribute(true)]
public ref class DesignSurfaceExtension abstract : IDisposable
[<AbstractClassAttribute>]
[<ComVisibleAttribute(true)>]
type DesignSurfaceExtension =  
    class
        interface IDisposable
    end
public abstract class DesignSurfaceExtension implements IDisposable

Remarks

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.

Inheritance Hierarchy

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

Thread Safety

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

See Also

Reference

DesignSurfaceExtension Members

Microsoft.VisualStudio.Shell.Design Namespace

DesignSurfaceExtensionAttribute

DesignSurface

IDesigner

IDesignerHost

Other Resources

Extending Design-Time Support