ProvideAutoLoadAttribute 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将此特性应用于 VSPackage 类,使其在指定的 UI 上下文处于活动状态时自动加载。 此类不能被继承。
public ref class ProvideAutoLoadAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
public ref class ProvideAutoLoadAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
public sealed class ProvideAutoLoadAttribute : Microsoft.VisualStudio.Shell.RegistrationAttribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)>]
type ProvideAutoLoadAttribute = class
inherit RegistrationAttribute
Public NotInheritable Class ProvideAutoLoadAttribute
Inherits RegistrationAttribute
- 继承
- 属性
注解
将此特性应用于继承自或实现的 VSPackage 类, Package IVsPackage 以使你的类在指定的 UI 上下文处于活动状态时自动加载。
此属性使 VSPackage 成为实现) 的对象 (的 IExtenderProvider 。 传递给构造函数的 GUID 决定包加载到的上下文。
此特性类只用于提供外部注册工具的数据。 它对 VSPackage 的运行时行为没有任何影响。
备注
Visual C# 自动将 "属性" 一词追加到任何 Attribute 类的名称中。 在 Visual C# 代码中,请将此属性称为 ProvideAutoLoad 。
备注
Visual C#和项目类型的 guid Visual Basic 分别为 {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 和 {F184B08F-C81C-45F6-A57F-5ABD9991F28F}。
注册表项
创建以下注册表项 ProvideAutoLoadAttribute :
<VSROOT>\AutoLoadPackages \ {ContextGuid}
<VSROOT>\AutoLoadPackages \ {ContextGuid} \ {PackageGuid} = 0
构造函数
| ProvideAutoLoadAttribute(String) |
返回具有指定的此属性的新实例 |
| ProvideAutoLoadAttribute(String, PackageAutoLoadFlags) |
使用指定的选项在指定的 UI 上下文中初始化 ProvideAutoloadAttribute 的新实例。 |
属性
| Flags |
获取 autoload 选项。 |
| LoadGuid |
返回将导致包加载的 UI 上下文 GUID。 |
| TypeId |
获取此属性的当前实例。 (继承自 RegistrationAttribute) |
方法
| GetPackageRegKeyPath(Guid) |
获取与 VSPackage 的应用程序) 的注册表根相关的注册表路径 (。 (继承自 RegistrationAttribute) |
| Register(RegistrationAttribute+RegistrationContext) |
提供 regpkg.exe 的外部注册工具调用的 VSPackage 的注册信息。 |
| Unregister(RegistrationAttribute+RegistrationContext) |
删除 regpkg.exe 的外部注册工具调用的有关 VSPackage 的注册信息。 |