InstalledProductRegistrationAttribute 类

为 Visual Studio 初始屏幕和 帮助 对话框提供信息,当应用于 Package派生类或实现的类 IVsPackage。此类不能被继承。

继承层次结构

System.Object
  System.Attribute
    Microsoft.VisualStudio.Shell.RegistrationAttribute
      Microsoft.VisualStudio.Shell.InstalledProductRegistrationAttribute

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

语法

声明
<AttributeUsageAttribute(AttributeTargets.Class, Inherited := False)> _
Public NotInheritable Class InstalledProductRegistrationAttribute _
    Inherits RegistrationAttribute
[AttributeUsageAttribute(AttributeTargets.Class, Inherited = false)]
public sealed class InstalledProductRegistrationAttribute : RegistrationAttribute

InstalledProductRegistrationAttribute 类型公开以下成员。

构造函数

  名称 说明
公共方法 InstalledProductRegistrationAttribute(String, String, String) 初始化 InstalledProductRegistrationAttribute 新实例使用指定的产品信息的。
公共方法 InstalledProductRegistrationAttribute(Boolean, String, String, String) 已过时。初始化指定的产品的新 InstalledProductRegistrationAttribute 实例。
公共方法 InstalledProductRegistrationAttribute(String, String, String, Boolean) 初始化指定的产品详细信息。 InstalledProductRegistrationAttribute 的新实例。

页首

属性

  名称 说明
公共属性 IconResourceID 获取或设置图标的资源 ID 与该产品。
公共属性 LanguageIndependentName 获取或设置该产品 (非本地化) 的名称。
公共属性 ProductDetails 获取或设置该产品的详细说明。
公共属性 ProductDetailsResourceID 获取或设置产品详细信息资源 ID.
公共属性 ProductId 获取或设置产品号。
公共属性 ProductName 获取或设置该产品的名称。
公共属性 ProductNameResourceID 获取或设置产品名称的资源 ID。
公共属性 TypeId 获取此属性的当前实例。 (继承自 RegistrationAttribute。)
公共属性 UseInterface 获取或包是否实现 IVsInstalledProduct 接口显示在初始屏幕的某 有关 对话框的位图和信息。 帮助 菜单。
公共属性 UsePackage 获取或设置产品安装是否使用包 ID.
公共属性 UseVsProductId 确定产品号是否与 Visual Studio ID.

页首

方法

  名称 说明
公共方法 Equals 基础结构。返回一个值,该值指示此实例是否与指定的对象相等。 (继承自 Attribute。)
公共方法 GetHashCode 返回此实例的哈希代码。 (继承自 Attribute。)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
公共方法 IsDefaultAttribute 当在派生类中重写时,指示此实例的值是否是派生类的默认值。 (继承自 Attribute。)
公共方法 Match 当在派生类中重写时,返回一个指示此实例是否等于指定对象的值。 (继承自 Attribute。)
公共方法 Register 有关 VSPackage 中注册信息,在调用由外部注册工具 (如 regpkg.exe。 (重写 RegistrationAttribute.Register(RegistrationAttribute.RegistrationContext)。)
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)
公共方法 Unregister 移除了有关 VSPackage 中注册信息,在调用由外部注册工具 (如 regpkg.exe。 (重写 RegistrationAttribute.Unregister(RegistrationAttribute.RegistrationContext)。)

页首

显式接口实现

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

页首

备注

在调用

将此特性应用于 VSPackage 类提供了 Visual Studio 初始屏幕和 帮助 对话框中显示的信息。

基本用法

帮助 对话框创建注册的一 InstalledProductRegistrationAttribute 对象 VSPackage。不同的构造函数提供选项使用 IVsInstalledProduct 接口 (实现的由包) 收集信息并将其显示在 Visual Studio 初始屏幕。若要使用此属性,请将其放置在 VSPackage 类 (类从该的 Package 或派生的实现 IVsPackage)。

此特性用于与 regpkg.exe 的外部注册工具仅提供数据。它没有为 VSPackage 的运行时行为的任何效果。有关更多信息,请参见 VSPackage 注册

说明说明

Visual C# 自动追加单词 属性 设置为任何特性类的名称。在 Visual C# 代码,请参见此属性作为 InstalledProductRegistration。

注册表项

以下注册表项由 InstalledProductRegistrationAttribute创建的:

  • VSROOT\CLSID\{PackageGuid}

  • VSROOT\CLSID\{PackageGuid}\@=ObjectType.FullName

  • VSROOT\CLSID\{PackageGuid}\InprocServer 32=mscoree.dll

  • VSROOT\CLSID\{PackageGuid}\Class=ObjectType.FullName

  • VSROOT\CLSID\{PackageGuid}\Assembly=ObjectType.Assembly.FullName

  • VSROOT\CLSID\{PackageGuid}\ThreadingModel=Both

  • VSROOT\CLSID\{PackageGuid}\CodeBase=context.CodeBase

  • VSROOT\CLSID\{PackageGuid}\SatelliteDll

  • VSROOT\CLSID\{PackageGuid}\SatelliteDll\Path=SatelliteDllPath

  • VSROOT\CLSID\{PackageGuid}\SatelliteDll\DllName=SatelliteDllName

示例

用于自动注册和其他属性的标准位置的这是在 Package 的实现的包装在 VsPkg.cs, VsPkg.vb 的或 VsPkg.cpp,基于用于该示例的语言。

线程安全

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

请参见

参考

Microsoft.VisualStudio.Shell 命名空间

其他资源

VSPackage 注册

MFC 应用程序中的本地化资源:附属 DLL