RegistrationAttribute.RegistrationContext Class

 

An abstract base class that provides context information from an external source to a registration attribute.

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

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

public abstract class RegistrationContext

NameDescription
System_CAPS_protmethodRegistrationAttribute.RegistrationContext()

Creates a new RegistrationAttribute.RegistrationContext.

NameDescription
System_CAPS_pubpropertyCodeBase

Gets the path and filename of the object being registered.

System_CAPS_pubpropertyComponentPath

Gets the path to the component that is being registered.

System_CAPS_pubpropertyComponentType

Gets the type of component being registered.

System_CAPS_pubpropertyInprocServerPath

Gets the path to the in-process server DLL.

System_CAPS_pubpropertyLog

Gets a TextWriter object that can be used to log events during registration.

System_CAPS_pubpropertyRegistrationMethod

Gets a value that specifies how the assembly should be located (CodeBase or Assembly).

System_CAPS_pubpropertyRootFolder

Gets or sets the root folder.

NameDescription
System_CAPS_pubmethodCreateKey(String)

Creates a new registration key by name.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodEscapePath(String)

Reformats a string as needed by the registration tool.

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodRemoveKey(String)

Removes an existing registration key.

System_CAPS_pubmethodRemoveKeyIfEmpty(String)

Removes the key of the specified name if it has no child key and no value.

System_CAPS_pubmethodRemoveValue(String, String)

Removes a value from a registration key.

System_CAPS_pubmethodToString()

(Inherited from Object.)

NameDescription
System_CAPS_pubmethodEscapeAssemblyRelativePath(String)

Returns an escaped string representing the full path of the specified folder relative to the assembly of the component being registered;(Defined by VsExtensionMethods.)

System_CAPS_pubmethodGetAssemblyLocation()

Returns the parent folder containing the assembly of the component being registered.(Defined by VsExtensionMethods.)

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

A RegistrationAttribute.RegistrationContext object is created by a registration utility such as CreatePkgDef 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.

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

Return to top
Show: