DefaultRegistryRootAttribute 类

定义默认的注册表根使用注册 VSPackage 信息。 此类不能被继承。

继承层次结构

System.Object
  System.Attribute
    Microsoft.VisualStudio.Shell.DefaultRegistryRootAttribute

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

语法

声明
<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple := False, Inherited := True)> _
Public NotInheritable Class DefaultRegistryRootAttribute _
    Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public sealed class DefaultRegistryRootAttribute : Attribute

DefaultRegistryRootAttribute 类型公开以下成员。

构造函数

  名称 说明
公共方法 DefaultRegistryRootAttribute 初始化与特定的注册表根的新 DefaultRegistryRootAttribute 对象。

页首

属性

  名称 说明
公共属性 Root 获取默认值注册表中的值支持 VSPackage。
公共属性 TypeId 当在派生类中实现时,获取该 Attribute 的唯一标识符。 (继承自 Attribute。)

页首

方法

  名称 说明
公共方法 Equals 基础结构。返回一个值,该值指示此实例是否与指定的对象相等。 (继承自 Attribute。)
公共方法 GetHashCode 返回此实例的哈希代码。 (继承自 Attribute。)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
公共方法 IsDefaultAttribute 当在派生类中重写时,指示此实例的值是否是派生类的默认值。 (继承自 Attribute。)
公共方法 Match 当在派生类中重写时,返回一个指示此实例是否等于指定对象的值。 (继承自 Attribute。)
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)

页首

显式接口实现

  名称 说明
显式接口实现私有方法 _Attribute.GetIDsOfNames 将一组名称映射为对应的一组调度标识符。 (继承自 Attribute。)
显式接口实现私有方法 _Attribute.GetTypeInfo 检索对象的类型信息,然后可以使用该信息获取接口的类型信息。 (继承自 Attribute。)
显式接口实现私有方法 _Attribute.GetTypeInfoCount 检索对象提供的类型信息接口的数量(0 或 1)。 (继承自 Attribute。)
显式接口实现私有方法 _Attribute.Invoke 提供对某一对象公开的属性和方法的访问。 (继承自 Attribute。)

页首

备注

重要

面向 Visual Studio 2010 的包仅不需要包打入键。

面向 Visual Studio 2008 和早期所需的包有一个包打入键来验证和加载 Vspackage。

在调用

对于面向 Visual Studio 2008 或早期版本的包,请将特性 DefaultRegistryRootAttribute 于 Package- 实现 IVsPackage 定义默认注册表的派生类或派生类支持包。

基本用法

应将此特性应用于所需的类实现包类和使用备用注册表根。 如果不存在,则使用默认的注册表根,这可防止包函数。 基本包类为包时生成 Visual Studio 的版本已提供此属性。

属性的值必须是完全限定的注册表根,如软件 \Microsoft\VisualStudio \ 8.0。 外部注册工具可以重写与自己的自定义根的默认注册表根。

此特性类仅用于为外部注册工具提供数据。 它没有为 VSPackage 的运行时行为的任何效果。 若要使用 DefaultRegistryRootAttribute,将它从 Package 派生或实现 IVsPackage的类。

线程安全

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

请参见

参考

Microsoft.VisualStudio.Shell 命名空间