/// <summary> /// Adds a command with an assosciated module. /// </summary> /// <param name="command"></param> /// <param name="fromModule"></param> public void AddCommand(ICommand command, IModule fromModule) { command.Parent = fromModule; command.Parent.Commands.Add(command); lock(__modules) { if (!__modules.ContainsKey(fromModule)) __modules.Add(fromModule, true); if (__modules[fromModule] == false) //if you're adding the command, you're enabling the module. __modules[fromModule] = true; } __commands.Add(command.CommandName, command); }
/// <summary> /// Adds a generic command without an associated module. /// </summary> /// <param name="command"></param> public void AddCommand(ICommand command) => __commands.Add(command.CommandName, command);