RegistrationAttribute.Key 类

提供表示注册键的抽象类。

继承层次结构

System.Object
  Microsoft.VisualStudio.Shell.RegistrationAttribute.Key

命名空间:  Microsoft.VisualStudio.Shell
程序集:  Microsoft.VisualStudio.Shell.Immutable.10.0(在 Microsoft.VisualStudio.Shell.Immutable.10.0.dll 中)

语法

声明
Public MustInherit Class Key _
    Implements IDisposable
public abstract class Key : IDisposable

RegistrationAttribute.Key 类型公开以下成员。

构造函数

  名称 说明
受保护的方法 RegistrationAttribute.Key 创建一个新的 RegistrationAttribute.Key 对象。

页首

方法

  名称 说明
公共方法 Close ,在编写完成后,关闭密钥。
公共方法 CreateSubkey 创建新记录键。新的键是当前 Key的子级。
公共方法 Equals 确定指定的对象是否等于当前对象。 (继承自 Object。)
受保护的方法 Finalize 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。)
公共方法 GetHashCode 用作特定类型的哈希函数。 (继承自 Object。)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
受保护的方法 MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
公共方法 SetValue 将名称设置为给定值。
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)

页首

显式接口实现

  名称 说明
显式接口实现私有方法 IDisposable.Dispose 配置对象及其资源。

页首

备注

在实现

注册工具 (例如 regpkg.exe) 进行使用注册特性类提供的信息必须实现此类、 RegistrationAttribute.Key,以及 RegistrationAttribute.RegistrationContext

基本用法

RegistrationAttribute.Key 对象由一注册实用工具创建例如 regpkg.exe。RegistrationAttribute.Key 可能表示物理注册表项,也可以表示在 .reg 或 .vrg 文件的信息。

当注册实用工具注册托管包程序集,它使用反射搜索程序集实现 RegistrationAttribute.Key的特性类。RegistrationAttribute.Key 对象放置到 RegistrationAttribute.RegistrationContext 对象传递给特性类的 Register 方法 (或 Unregister) 方法。

特性类在 RegistrationAttribute.Key 和 RegistrationAttribute.RegistrationContext 对象使用信息实际执行必要的注册任务。

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参见

参考

Microsoft.VisualStudio.Shell 命名空间

RegistrationAttribute

RegistrationAttribute.RegistrationContext

其他资源

Managed VSPackage Registration Keys

注册 Vspackage