Export (0) Print
Expand All

DesignSurfaceExtensionAttribute Class

Notifies the Visual Studio environment that a VSPackage provides a Type implementing a service to customize or extend services provided by any implementation of DesignSurface at designer load time.

Namespace: Microsoft.VisualStudio.Shell.Design
Assembly: Microsoft.VisualStudio.Shell.Design (in microsoft.visualstudio.shell.design.dll)

[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=true, Inherited=true)] 
public sealed class DesignSurfaceExtensionAttribute : RegistrationAttribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=true, Inherited=true) */ 
public final class DesignSurfaceExtensionAttribute extends RegistrationAttribute
AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=true, Inherited=true) 
public final class DesignSurfaceExtensionAttribute extends RegistrationAttribute

Attribute Context

Applies to

Classes providing VSPackages by implementing the IVsPackage interface or the Package interface.

Repeatable

No

Required attributes

An instance each of ProvideObjectAttribute and ProvideServiceAttribute constructed with the Type of the class registered by the DesignSurfaceExtensionAttribute as implementing the DesignSurfaceExtension.

Invalid attributes

None

This Attribute specifies a Type as implementing a service providing customization or extension of the services provided by any implementation of DesignSurface used by the VSPackage.

DesignSurfaceExtensionAttribute is only used for registration purposes and does not affect how code behaves at runtime.

Instances of this Attribute should only be applied to classes implementing Package for a VSPackage.

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 

System.Object
   System.Attribute
     Microsoft.VisualStudio.Shell.RegistrationAttribute
      Microsoft.VisualStudio.Shell.Design.DesignSurfaceExtensionAttribute

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

Community Additions

ADD
Show:
© 2014 Microsoft