示例#1
0
 public static void CommandRegisteredPriority([NotNull] EventHandler <CommandRegisteredEventArgs> callback, Priority priority)
 {
     if (callback == null)
     {
         throw new ArgumentNullException("callback");
     }
     CommandRegisteredEvent.Add(callback, priority);
 }
        protected void RegisterCommand(ICommand command)
        {
            if (command.Names.Any(x => GetCommand(x) != null))
            {
                throw new CommandAlreadyRegisteredException(command.Name, Name);
            }
            _subCommands.Add(command);

            command.WriteEvent += OnOutputEvent;

            CommandRegisteredEvent?.Invoke(this, new CommandRegisteredEventArgs(command));
        }