/// <summary> /// Registers the specified command, using the command's Name as a key. /// </summary> /// <param name="command"></param> public void RegisterCommand(RadDockCommand command) { if (command == null) { throw new ArgumentNullException("Command"); } if (this.commands.ContainsKey(command.Name)) { throw new ArgumentException("Command with the specified name is already registered."); } this.commands.Add(command.Name, command); }
/// <summary> /// Attempts to execute the RadDockCommand which matches the specified name. /// </summary> /// <param name="name"></param> public void ExecuteCommand(string name) { if (!this.enabled) { return; } RadDockCommand command = this.FindCommandByName(name); if (command != null && command.CanExecute(this.dockManager)) { command.Execute(this.dockManager); } }