Share via


RegisterAutoLoadAttribute 类

定义

注意

RegisterAutoLoadAttribute has been deprecated. Please use ProvideAutoLoadAttribute instead.

此属性将包注册为扩展程序。 传入的 GUID 决定了要扩展的内容。 包上的属性不控制包的行为,但注册工具可以使用它们向 Visual Studio 注册适当的信息。

public ref class RegisterAutoLoadAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
public ref class RegisterAutoLoadAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
[System.Obsolete("RegisterAutoLoadAttribute has been deprecated. Please use ProvideAutoLoadAttribute instead.")]
public sealed class RegisterAutoLoadAttribute : Microsoft.VisualStudio.Shell.RegistrationAttribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)>]
[<System.Obsolete("RegisterAutoLoadAttribute has been deprecated. Please use ProvideAutoLoadAttribute instead.")>]
type RegisterAutoLoadAttribute = class
    inherit RegistrationAttribute
Public NotInheritable Class RegisterAutoLoadAttribute
Inherits RegistrationAttribute
继承
RegisterAutoLoadAttribute
属性

注解

基本用法

RegisterAutoLoadAttribute 将 VSPackage 注册为扩展程序, (实现 IExtenderProvider的对象。 传递给构造函数的 GUID 确定加载包的上下文。 若要使用 RegisterAutoLoadAttribute,请将其放在包类上,例如 Package 或实现 的 IVsPackage类。

此属性类仅用于为外部注册工具提供数据。 它对 VSPackage 的运行时行为没有任何影响。

注意

Visual C# 会自动将“Attribute”一词追加到任何属性类的名称中。 在 Visual C# 代码中,此属性为 RegisterAutoLoad

注册表项

以下注册表项由 RegisterAutoLoadAttribute创建:

  • <VSROOT>\AutoLoadPackages\{ContextGuid}

  • <VSROOT>\AutoLoadPackages\{ContextGuid}\{PackageGuid}=0

示例

可以在托管示例中找到 类的实现 RegisterAutoLoadAttribute 。 此属性和用于自动注册的所有其他属性的标准位置与 VsPkg.cs、VsPkg.vb 或 VsPkg.cpp 中的 类的实现 Package 相邻,具体取决于示例中使用的语言。

构造函数

RegisterAutoLoadAttribute(String)
已过时.

指定此上下文处于活动状态时应加载包。

属性

LoadGuid
已过时.

触发包加载的上下文 Guid。

TypeId
已过时.

重写 TypeID 属性,以便让 RegistrationAttribute 派生类与 System.ComponentModel.TypeDescriptor.GetAttributes 一起使用 (...) 。仅当派生自此属性的属性需要对可应用于类的实例使用更好的控件时,它才必须重写此属性。

(继承自 RegistrationAttribute)

方法

GetPackageRegKeyPath(Guid)
已过时.

获取相对于 VSPackage 的应用程序) 注册表根目录 (注册表路径。

(继承自 RegistrationAttribute)
Register(RegistrationAttribute+RegistrationContext)
已过时.

调用以便向给定的上下文注册此属性。 上下文包含应放置注册信息的位置。 它还包含正在注册的类型和路径信息。

Unregister(RegistrationAttribute+RegistrationContext)
已过时.

取消注册此自动加载规范。

适用于