ProvideToolWindowAttribute 类

请注意 Visual Studio VSPackage 拥有一个工具窗口。

继承层次结构

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

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

语法

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

ProvideToolWindowAttribute 类型公开以下成员。

构造函数

  名称 说明
公共方法 ProvideToolWindowAttribute 初始化 ProvideToolWindowAttribute 的新实例。

页首

属性

  名称 说明
公共属性 DockedHeight
公共属性 DockedWidth
公共属性 DocumentLikeTool
公共属性 Height 获取或设置工具窗口的默认高度。
公共属性 MultiInstances 确定工具窗口的多个实例是否允许。
公共属性 Orientation 获取或设置工具窗口的默认方向相对于窗口属性指定的窗口。
公共属性 PositionX 获取或设置默认的工具窗口的左上角的水平值。
公共属性 PositionY 获取或设置工具窗口的左上角的垂直值。
公共属性 Style 获取或设置工具窗口的默认停靠样式。
公共属性 ToolType 获取或设置工具窗口的类型。
公共属性 Transient 获取或设置是否不应重新打开工具窗口时, IDE 重新启动时。
公共属性 TypeId 获取此属性的当前实例。 (继承自 RegistrationAttribute。)
公共属性 Width 获取或设置工具窗口的默认宽度。
公共属性 Window 获取或设置工具窗口应停靠默认窗口的 GUID。

页首

方法

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

页首

显式接口实现

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

页首

备注

在调用

,在 VSPackage 实现一个或多个工具窗口,则实现 ProvideToolWindowAttribute 类。

基本用法

此特性声明特定 VSPackage 拥有一个工具窗口。,则在创建集合时,它还有助于确定工具窗口进行定位和持久性。若要使用 ProvideToolWindowAttribute,请将其放置在从派生 Package 或实现 IVsPackage的包类。

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

注册表项

  • ProvideToolWindowAttribute 类创建以下注册表项:

  • VSROOT\ToolWindows\{ToolWindowGuid}

  • VSROOT\ToolWindows\{ToolWindowGuid}\@={ToolWindowTypeGuid}

  • VSROOT\ToolWindows\{ToolWindowGuid}\Name=ToolWindowName

  • 以下注册表项是可选的:

  • VSROOT\ToolWindows\{ToolWindowGuid}\Float=FloatPosition

  • VSROOT\ToolWindows\{ToolWindowGuid}\Style=ToolWindowStyle

  • VSROOT\ToolWindows\{ToolWindowGuid}\Window=DockWith

  • VSROOT\ToolWindows\{ToolWindowGuid}\Orientation=ToolWindowOrientation

线程安全

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

请参见

参考

Microsoft.VisualStudio.Shell 命名空间