RegistrationAttribute.RegistrationContext RegistrationAttribute.RegistrationContext RegistrationAttribute.RegistrationContext RegistrationAttribute.RegistrationContext RegistrationAttribute.RegistrationContext Class

Definition

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

public: ref class RegistrationAttribute::RegistrationContext abstract
[Windows::Foundation::Metadata::WebHostHidden]
class RegistrationAttribute::RegistrationContext abstract
public abstract class RegistrationAttribute.RegistrationContext
type RegistrationAttribute.RegistrationContext = class
Public MustInherit Class RegistrationAttribute.RegistrationContext
Inheritance
RegistrationAttribute.RegistrationContextRegistrationAttribute.RegistrationContextRegistrationAttribute.RegistrationContextRegistrationAttribute.RegistrationContextRegistrationAttribute.RegistrationContext

Remarks

When to Implement

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.

Basic Usage

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.

Constructors

RegistrationAttribute.RegistrationContext() RegistrationAttribute.RegistrationContext() RegistrationAttribute.RegistrationContext() RegistrationAttribute.RegistrationContext() RegistrationAttribute.RegistrationContext()

Creates a new RegistrationAttribute.RegistrationContext.

Properties

CodeBase CodeBase CodeBase CodeBase CodeBase

Gets the path and filename of the object being registered.

ComponentPath ComponentPath ComponentPath ComponentPath ComponentPath

Gets the path to the component that is being registered.

ComponentType ComponentType ComponentType ComponentType ComponentType

Gets the type of component being registered.

InprocServerPath InprocServerPath InprocServerPath InprocServerPath InprocServerPath

Gets the path to the in-process server DLL.

Log Log Log Log Log

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

RegistrationMethod RegistrationMethod RegistrationMethod RegistrationMethod RegistrationMethod

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

RootFolder RootFolder RootFolder RootFolder RootFolder

Gets or sets the root folder.

Methods

CreateKey(String) CreateKey(String) CreateKey(String) CreateKey(String) CreateKey(String)

Creates a new registration key by name.

EscapePath(String) EscapePath(String) EscapePath(String) EscapePath(String) EscapePath(String)

Reformats a string as needed by the registration tool.

RemoveKey(String) RemoveKey(String) RemoveKey(String) RemoveKey(String) RemoveKey(String)

Removes an existing registration key.

RemoveKeyIfEmpty(String) RemoveKeyIfEmpty(String) RemoveKeyIfEmpty(String) RemoveKeyIfEmpty(String) RemoveKeyIfEmpty(String)

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

RemoveValue(String, String) RemoveValue(String, String) RemoveValue(String, String) RemoveValue(String, String) RemoveValue(String, String)

Removes a value from a registration key.

Extension Methods

FindAncestor<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestor<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestor<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestor<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestor<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>)
FindAncestor<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestor<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestor<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestor<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestor<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>)

Microsoft internal use only.

FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>)
FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>)
IsAncestorOf<TElementType>(TElementType, TElementType, Func<TElementType,TElementType>) IsAncestorOf<TElementType>(TElementType, TElementType, Func<TElementType,TElementType>) IsAncestorOf<TElementType>(TElementType, TElementType, Func<TElementType,TElementType>) IsAncestorOf<TElementType>(TElementType, TElementType, Func<TElementType,TElementType>) IsAncestorOf<TElementType>(TElementType, TElementType, Func<TElementType,TElementType>)

Microsoft internal use only.

EscapeAssemblyRelativePath(RegistrationAttribute+RegistrationContext, String) EscapeAssemblyRelativePath(RegistrationAttribute+RegistrationContext, String) EscapeAssemblyRelativePath(RegistrationAttribute+RegistrationContext, String) EscapeAssemblyRelativePath(RegistrationAttribute+RegistrationContext, String) EscapeAssemblyRelativePath(RegistrationAttribute+RegistrationContext, String)

Returns an escaped string representing the full path of the specified folder relative to the assembly of the component being registered

GetAssemblyLocation(RegistrationAttribute+RegistrationContext) GetAssemblyLocation(RegistrationAttribute+RegistrationContext) GetAssemblyLocation(RegistrationAttribute+RegistrationContext) GetAssemblyLocation(RegistrationAttribute+RegistrationContext) GetAssemblyLocation(RegistrationAttribute+RegistrationContext)

Returns the parent folder containing the assembly of the component being registered

Applies to