Tool 类
更新:2007 年 11 月
表示确定设计器模式的工具。
命名空间: Microsoft.Windows.Design.Interaction
程序集: Microsoft.Windows.Design.Interaction(在 Microsoft.Windows.Design.Interaction.dll 中)
语法
声明
Public Class Tool _
Inherits ContextItem
用法
Dim instance As Tool
public class Tool : ContextItem
public ref class Tool : public ContextItem
public class Tool extends ContextItem
备注
所有用户输入都流经当前处于活动状态的工具。要激活工具,应将它设置到编辑上下文的 ContextItemManager 类中。您还可以在 ContextItemManager 上处理更改通知,以了解活动工具何时更改。当用户输入进入设计器视图时,设计器视图会在编辑上下文中找到活动工具,并要求它将用户输入解析为命令绑定。之后将调用所生成的命令绑定。
一个工具由一个任务集合组成,这些任务由 Task 类表示。每个任务包含一个可以调用的命令的集合,以及激活这些命令的输入绑定的集合。工具还可以使用命中测试逻辑来发现装饰器所提供的任务。
继承层次结构
System.Object
Microsoft.Windows.Design.ContextItem
Microsoft.Windows.Design.Interaction.Tool
Microsoft.Windows.Design.Interaction.CreationTool
Microsoft.Windows.Design.Interaction.SelectionTool
线程安全
此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。
另请参见
参考
Microsoft.Windows.Design.Interaction 命名空间