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)

Syntax

‘선언
<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple := True, Inherited := True)> _
Public NotInheritable Class DesignSurfaceExtensionAttribute _
    Inherits RegistrationAttribute
‘사용 방법
Dim instance As DesignSurfaceExtensionAttribute
[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public sealed class DesignSurfaceExtensionAttribute : RegistrationAttribute
[AttributeUsageAttribute(AttributeTargets::Class, AllowMultiple = true, Inherited = true)]
public ref class DesignSurfaceExtensionAttribute sealed : public RegistrationAttribute
[<SealedAttribute>]
[<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = true, Inherited = true)>]
type DesignSurfaceExtensionAttribute =  
    class
        inherit RegistrationAttribute
    end
public final class DesignSurfaceExtensionAttribute extends RegistrationAttribute

Remarks

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.

Examples

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 

Inheritance Hierarchy

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

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

DesignSurfaceExtensionAttribute Members

Microsoft.VisualStudio.Shell.Design Namespace

DesignSurfaceExtension

DesignSurfaceExtensionAttribute

DesignSurface

IDesigner

IDesignerHost

Other Resources

Extending Design-Time Support