Share via


RegistrationAttribute Class

Definition

An abstract class for VSPackage registration. The RegistrationAttribute class allows new registration information to be added without changing the registration tools.

public ref class RegistrationAttribute abstract : Attribute
[System.AttributeUsage(System.AttributeTargets.Class)]
[System.CLSCompliant(true)]
public abstract class RegistrationAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class)]
public abstract class RegistrationAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
[<System.CLSCompliant(true)>]
type RegistrationAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
type RegistrationAttribute = class
    inherit Attribute
Public MustInherit Class RegistrationAttribute
Inherits Attribute
Inheritance
RegistrationAttribute
Derived
Attributes

Remarks

When to Implement

Derive a registration attribute from RegistrationAttribute to create a class that makes specialized registry entries when applied to your Package-derived class or a class that implements IVsPackage.

Basic Usage

Attribute classes that provide VSPackage registration information. Regpkg.exe or other registration tools must derive from and implement RegistrationAttribute. For more information, see Registering VSPackages.

RegistrationAttribute is an abstract attribute class that enables VSPackage developers to add registration attribute classes without needing to change the registration tools.

Attribute classes that provide registration information to regpkg.exe or other registration tools must derive from RegistrationAttribute, and must implement the Register and Unregister abstract methods.

Registration tools such as regpkg.exe must implement the classes RegistrationAttribute.Key and RegistrationAttribute.RegistrationContext.

Constructors

RegistrationAttribute()

Initializes a new instance of the class.

Properties

TypeId

Override the TypeID property in order to let the RegistrationAttribute derived classes to work with System.ComponentModel.TypeDescriptor.GetAttributes(...). An attribute derived from this one will have to override this property only if it needs a better control on the instances that can be applied to a class.

Methods

GetPackageRegKeyPath(Guid)

Gets the registry path (relative to the registry root of the application) of the VSPackage.

Register(RegistrationAttribute+RegistrationContext)

Registers this VSPackage with a given context, when called by an external registration tool such as regpkg.exe. For more information, see Registering VSPackages.

Unregister(RegistrationAttribute+RegistrationContext)

Called to unregister this attribute with the given context.

Applies to