예제 #1
0
 public TalkyCommand Get(string command)
 {
     lock (_lock)
     {
         TalkyCommand theCommand = null;
         _commands.TryGetValue(command.ToLower(), out theCommand);
         return(theCommand);
     }
 }
예제 #2
0
        public void RegisterCommand(TalkyCommand command)
        {
            lock (_lock)
            {
                if (_commands.ContainsValue(command) || _commands.ContainsKey(command.CommandName.ToLower()))
                {
                    throw new CommandExistsException("That command exists, you nutter!", command);
                }

                _commands.Add(command.CommandName.ToLower(), command);
            }
        }
예제 #3
0
        public void RegisterCommand(TalkyCommand command)
        {
            lock (_lock)
            {
                if (_commands.ContainsValue(command) || _commands.ContainsKey(command.CommandName.ToLower()))
                {
                    throw new CommandExistsException("That command exists, you nutter!", command);
                }

                _commands.Add(command.CommandName.ToLower(), command);
            }
        }
예제 #4
0
 public CommandExistsException(string message, TalkyCommand command) : base(message)
 {
     Command = command;
 }
예제 #5
0
 public void UnregisterCommand(TalkyCommand command)
 {
     UnregisterCommand(command.CommandName);
 }
예제 #6
0
 public void UnregisterCommand(TalkyCommand command)
 {
     UnregisterCommand(command.CommandName);
 }