Ejemplo n.º 1
0
 public Framework.ICommand Route(string[] args)
 {
     Framework.ICommand cmd = null;
     if (0 == args.Length)
     {
         cmd = new Command.DefaultCommand();
     }
     else if (1 == args.Length)
     {
         cmd = this.GetCommandBy1Augs(args[0]);
     }
     else if (2 == args.Length)
     {
         cmd = this.GetCommandBy2Augs(args);
     }
     else if (3 == args.Length)
     {
         cmd = new Command.LocaleFormatCommand();
     }
     else
     {
         cmd = new Command.HelpCommand();
     }
     return(cmd);
 }
        public static void Main(string[] args)
        {
            CommandRouter router = new CommandRouter();

            Framework.ICommand cmd = router.Route(args);
            cmd.Execute();
        }
Ejemplo n.º 3
0
 public Task <ExecutionResult> Execute(Framework.ICommand command)
 {
     return(Execute((T)command));
 }