示例#1
0
        private static void RunWithArgString(ConsoleCommandExecutor executor, string args)
        {
            Console.WriteLine("----------------------------------------------------------");
            Console.WriteLine("Running with args: " + args);
            var argArray = args == null
                ? new string[0]
                : args.Split();

            executor.Execute(argArray);
        }
示例#2
0
        void ExecuteCommands()
        {
            var executor = new ConsoleCommandExecutor(
                ServiceLocator.GetService <IEnumerable <ICommandLocator> >(),
                ServiceLocator.GetService <IEventHub>(),
                ServiceLocator.GetService <ICommandOutputFormatter>());

            foreach (var command in _commands)
            {
                executor.Execute(command, Enumerable.Empty <string>());
            }
        }