This documentation is archived and is not being maintained.

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

The DesignSurfaceExtensionAttribute type exposes the following members.

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

Public propertyExtensionTypeThe Type of the object registered as providing a VSPackage with an implementation of DesignSurfaceExtension to customize design surfaces.
Public propertyLoadAtIdleControls when, relative to the loading of a designer used by a VSPackage, the extensions provided by the implementation of the DesignSurfaceExtensionAttribute registered by DesignSurfaceExtensionAttribute are installed.
Public propertyTypeIdGets the current instance of this attribute. (Inherited from RegistrationAttribute.)

Public methodEqualsInfrastructure. Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns the hash code for this instance. (Inherited from Attribute.)
Protected methodGetPackageRegKeyPathGets the registry path (relative to the registry root of the application) of the VSPackage. (Inherited from RegistrationAttribute.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIsDefaultAttributeWhen overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Inherited from Attribute.)
Public methodMatchWhen overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRegisterRegisters the design surface extension. (Overrides RegistrationAttribute.Register(RegistrationAttribute.RegistrationContext).)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodUnregisterRemoves the design surface extension registry key. (Overrides RegistrationAttribute.Unregister(RegistrationAttribute.RegistrationContext).)

Explicit interface implemetationPrivate method_Attribute.GetIDsOfNamesMaps a set of names to a corresponding set of dispatch identifiers. (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.GetTypeInfoRetrieves the type information for an object, which can be used to get the type information for an interface. (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.GetTypeInfoCountRetrieves the number of type information interfaces that an object provides (either 0 or 1). (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.InvokeProvides access to properties and methods exposed by an object. (Inherited from Attribute.)

Attribute Context

Applies to

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



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


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.

class CustomDesigner : Package 

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