Esempio n. 1
0
 public void AddObserver(string name, string signature, string helpText, ExecConsoleCmd callback)
 {
     _observers.Add(new CmdConsoleObserver
     {
         name      = name,
         signature = signature,
         helpText  = helpText,
         callback  = callback
     });
 }
Esempio n. 2
0
 public void AddCommand(string name, string signature, string helpText, ExecConsoleCmd callback)
 {
     if (_observers.Any(x => x.name == name))
     {
         throw new ArgumentException($"Command name {name} already taken!");
     }
     _observers.Add(new CmdConsoleObserver
     {
         name      = name,
         signature = signature,
         helpText  = helpText,
         callback  = callback
     });
 }