Ejemplo n.º 1
0
 public override void OnInvoke(CommandInvoker invoker, CommandArguments args)
 {
     if (!(args.IsEmpty()) && args.GetArgumentAtPosition(0) == "@off")
     {
         invoker.GetProcessor().Echo = false;
     }
     else if (!(args.IsEmpty()) && args.GetArgumentAtPosition(0) == "@on")
     {
         invoker.GetProcessor().Echo = true;
     }
     else if (!(args.IsEmpty()))
     {
         string s = "";
         for (int i = 0; i < args.Count(); i++)
         {
             var x = args.GetArgumentAtPosition(i);
             if (s == "" || s == null)
             {
                 s = x;
             }
             else
             {
                 s += $" {x}";
             }
         }
         Console.WriteLine(s);
     }
     else
     {
         Console.WriteLine("Huh, somehow we ended up here...?");
     }
 }