Exemplo n.º 1
0
 /// <summary>
 /// Add a new command to the current context.
 /// </summary>
 /// <param name="commandName">String describing which command was use to invoke the method.</param>
 /// <param name="commandHandle">The parameters to the command, if any.</param>
 public void AddCommand(string commandName, CommandHandle commandHandle)
 {
     if (string.IsNullOrEmpty(commandName))
     {
         throw new ArgumentNullException("AddCommand: parameter commandName null or empty");
     }
     else if (string.IsNullOrWhiteSpace(commandName))
     {
         throw new ArgumentNullException("AddCommand: parameter commandName name consists of whitespace");
     }
     else if (commandHandle == null)
     {
         throw new ArgumentNullException("AddCommand: null parameter commandHandle");
     }
     else
     {
         Commands.Add(commandName, commandHandle);
     }
 }
Exemplo n.º 2
0
 public BotHandler()
 {
     _handler = new CommandHandle();
 }