/// <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); }
public ModuleNotEnabledException(string message, IModule module) : base(message) { this.module = module; }