|
AnyCAD Rapid API 2026
Help you to create a better world!
|
命令管理器类(单例) 更多...
Public 成员函数 | |
| CommandManager (global::System.IntPtr cPtr, bool cMemoryOwn) | |
| 仅供内部使用 | |
| void | Dispose () |
| Command | Find (string name) |
| 根据名称查找命令 | |
| void | AddListener (CommandListener listener) |
| 添加命令监听器 | |
| void | RemoveListener (CommandListener listener) |
| 移除监听器 | |
| bool | Execute (string command, ParameterDict parameters, Viewer viewer, Document document, bool clearEditor) |
| 执行命令 | |
| bool | Execute (string command, ParameterDict parameters, Viewer viewer, Document document) |
| 执行命令 | |
| bool | Execute (string command, CommandContext ctx, bool clearEditor) |
| 执行命令(使用上下文) | |
| bool | Execute (string command, CommandContext ctx) |
| 执行命令(使用上下文) | |
| bool | Execute (string command, CommandContext ctx, string input, bool clearEditor) |
| 执行命令(带输入字符串) | |
| bool | Execute (string command, CommandContext ctx, string input) |
| 执行命令(带输入字符串) | |
| string | Query (string command, ParameterDict parameters, Viewer viewer, Document document) |
| 执行查询命令 | |
| string | Query (string command, CommandContext ctx) |
| 执行查询命令(使用上下文) | |
| void | OnMessage (Viewer viewer, EnumCommandType type, string msg, string content) |
| 发送消息给命令监听器 | |
| void | OnMessage (Viewer viewer, EnumCommandType type, string msg) |
| 发送消息给命令监听器 | |
| bool | InternalAdd (Command command) |
| 内部添加命令方法 | |
静态 Public 成员函数 | |
| static CommandManager | Instance () |
| static CommandManager | GetInstance () |
命令管理器类(单例)
全局命令管理,负责注册、查找和执行命令。 支持命令监听器机制,实现命令执行的观察者模式。
| void AnyCAD.Foundation.CommandManager.AddListener | ( | CommandListener | listener | ) |
添加命令监听器
| listener | 监听器对象 |
| bool AnyCAD.Foundation.CommandManager.Execute | ( | string | command, |
| CommandContext | ctx ) |
执行命令(使用上下文)
| command | 命令名称 |
| ctx | 命令上下文 |
| bool AnyCAD.Foundation.CommandManager.Execute | ( | string | command, |
| CommandContext | ctx, | ||
| bool | clearEditor ) |
执行命令(使用上下文)
| command | 命令名称 |
| ctx | 命令上下文 |
| clearEditor | 是否清空当前的编辑器(默认true) |
| bool AnyCAD.Foundation.CommandManager.Execute | ( | string | command, |
| CommandContext | ctx, | ||
| string | input ) |
执行命令(带输入字符串)
| command | 命令名称 |
| ctx | 命令上下文 |
| input | 输入字符串 |
| bool AnyCAD.Foundation.CommandManager.Execute | ( | string | command, |
| CommandContext | ctx, | ||
| string | input, | ||
| bool | clearEditor ) |
执行命令(带输入字符串)
| command | 命令名称 |
| ctx | 命令上下文 |
| input | 输入字符串 |
| clearEditor | 是否清空当前的编辑器(默认true) |
| bool AnyCAD.Foundation.CommandManager.Execute | ( | string | command, |
| ParameterDict | parameters, | ||
| Viewer | viewer, | ||
| Document | document ) |
执行命令
| command | 命令名称 |
| parameters | 参数字典 |
| viewer | 当前视图 |
| document | 当前文档 |
| bool AnyCAD.Foundation.CommandManager.Execute | ( | string | command, |
| ParameterDict | parameters, | ||
| Viewer | viewer, | ||
| Document | document, | ||
| bool | clearEditor ) |
执行命令
| command | 命令名称 |
| parameters | 参数字典 |
| viewer | 当前视图 |
| document | 当前文档 |
| clearEditor | 是否清空当前的编辑器(默认true) |
| Command AnyCAD.Foundation.CommandManager.Find | ( | string | name | ) |
根据名称查找命令
| name | 命令名称 |
| bool AnyCAD.Foundation.CommandManager.InternalAdd | ( | Command | command | ) |
内部添加命令方法
| command | 命令对象 |
禁止外部直接调用,仅供内部使用
| void AnyCAD.Foundation.CommandManager.OnMessage | ( | Viewer | viewer, |
| EnumCommandType | type, | ||
| string | msg ) |
发送消息给命令监听器
| viewer | 视图对象 |
| type | 命令执行类型 |
| msg | 消息标题 |
| void AnyCAD.Foundation.CommandManager.OnMessage | ( | Viewer | viewer, |
| EnumCommandType | type, | ||
| string | msg, | ||
| string | content ) |
发送消息给命令监听器
| viewer | 视图对象 |
| type | 命令执行类型 |
| msg | 消息标题 |
| content | 消息内容(可选) |
| string AnyCAD.Foundation.CommandManager.Query | ( | string | command, |
| CommandContext | ctx ) |
执行查询命令(使用上下文)
| command | 命令名称 |
| ctx | 命令上下文 |
| string AnyCAD.Foundation.CommandManager.Query | ( | string | command, |
| ParameterDict | parameters, | ||
| Viewer | viewer, | ||
| Document | document ) |
执行查询命令
| command | 命令名称 |
| parameters | 参数字典 |
| viewer | 视图对象 |
| document | 文档对象 |
| void AnyCAD.Foundation.CommandManager.RemoveListener | ( | CommandListener | listener | ) |
移除监听器
| listener | 监听器对象 |