ProvideToolWindowAttribute 类   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
通知 Visual Studio VSPackage 拥有工具窗口。
public ref class ProvideToolWindowAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
	public ref class ProvideToolWindowAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
	[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
public sealed class ProvideToolWindowAttribute : Microsoft.VisualStudio.Shell.RegistrationAttribute
	[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)>]
type ProvideToolWindowAttribute = class
    inherit RegistrationAttribute
	Public NotInheritable Class ProvideToolWindowAttribute
Inherits RegistrationAttribute
		- 继承
 
- 属性
 
注解
何时调用
ProvideToolWindowAttribute当 VSPackage 实现一个或多个工具窗口时实现 类。
基本用法
此属性声明特定 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
构造函数
| ProvideToolWindowAttribute(Type) | 
		 初始化 ProvideToolWindowAttribute 的新实例。  | 
        	
属性
| AutoHidden | 
		 设置为 true 可默认隐藏工具窗口。  | 
        	
| DockedHeight | 
		 获取 ore 设置停靠时 ToolWindow 的默认高度。  | 
        	
| DockedWidth | 
		 获取 ore 设置停靠时 ToolWindow 的默认宽度。  | 
        	
| DocumentLikeTool | 
		 如果需要工具窗口的行为和生存期类似于文档,请将此属性设置为 true。 工具窗口将仅是 MDI 或浮动的,并且在所有布局更改中保持可见的位置,直到用户手动关闭,此时它将销毁。 此标志表示 DontForceCreate 和破坏性多实例。  | 
        	
| Height | 
		 获取或设置工具窗口的默认高度。  | 
        	
| MultiInstances | 
		 确定是否允许使用工具窗口的多个实例。  | 
        	
| Orientation | 
		 获取或设置工具窗口相对于 Window 属性指定的窗口的默认方向。  | 
        	
| PositionX | 
		 获取或设置工具窗口左上角的默认水平值。  | 
        	
| PositionY | 
		 获取或设置工具窗口左上角的垂直值。  | 
        	
| Style | 
		 获取或设置工具窗口的默认停靠样式。  | 
        	
| ToolType | 
		 获取或设置工具窗口的类型。  | 
        	
| Transient | 
		 获取或设置在 IDE 重启时是否不应重新打开工具窗口。  | 
        	
| TypeId | 
		 重写 TypeID 属性,使 RegistrationAttribute 派生类能够与 System.ComponentModel.TypeDescriptor.GetAttributes 一起使用 (...) 。仅当派生自此属性的属性需要对可应用于类的实例使用更好的控件时,它才必须重写此属性。 (继承自 RegistrationAttribute) | 
        	
| Width | 
		 获取或设置工具窗口的默认宽度。  | 
        	
| Window | 
		 获取或设置工具窗口应停靠的默认窗口的 GUID。  | 
        	
方法
| GetPackageRegKeyPath(Guid) | 
		 获取相对于 VSPackage 的应用程序) 注册表根目录 (注册表路径。 (继承自 RegistrationAttribute) | 
        	
| Register(RegistrationAttribute+RegistrationContext) | 
		 注册工具窗口。  | 
        	
| Unregister(RegistrationAttribute+RegistrationContext) | 
		 删除工具窗口的注册表项。  |