Partager via


RegistrationAttribute.RegistrationContext Class

An abstract base class for objects providing context information from an external source to a registration attribute.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)

Syntax

Public MustInherit Class RegistrationContext

Dim instance As RegistrationContext
public abstract class RegistrationContext
public ref class RegistrationContext abstract
public abstract class RegistrationContext

Remarks

When to Implement

Registration tools (such as RegPkg.exe) that use the information provided by the registration attribute classes must implement this class, RegistrationAttribute.RegistrationContext, as well as RegistrationAttribute.Key.

Basic Usage

A RegistrationAttribute.RegistrationContext object is created by a registration utility such as RegPkg.exe or the Windows Installer to provide information to a registration attribute. The registration context includes the type of object that is being registered, the object's path, and helper properties. It is also used to create keys that can be used to write registration information.

When the registration utility registers a managed package assembly, it uses reflection to search the assembly for attribute classes that implement the RegistrationAttribute class. A RegistrationAttribute.Key object is placed into the RegistrationAttribute.RegistrationContext object and passed to the Register (or Unregister) method of the attribute class.

The attribute class uses the information in the RegistrationAttribute.Key and RegistrationAttribute.RegistrationContext objects to actually carry out the registration tasks required by the attribute.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Shell.RegistrationAttribute.RegistrationContext

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

Concepts

Managed VSPackage Registration Keys

How to: Register Managed VSPackages

Reference

RegistrationAttribute.RegistrationContext Members

Microsoft.VisualStudio.Shell Namespace

RegistrationAttribute

RegistrationAttribute.RegistrationContext