Пример #1
0
        public static int Main(string[] args)
        {
            var consoleCommands = ConsoleCommandDispatcher.FindCommandsInAssembly(typeof(Program).Assembly);

            var result = ConsoleCommandDispatcher.DispatchCommand(consoleCommands, args, System.Console.Out);

            System.Console.WriteLine("Press any key to exit.");
            System.Console.ReadLine();

            return(result);
        }
Пример #2
0
        static int Main(string[] args)
        {
            Console.InputEncoding  = Encoding.UTF8;
            Console.OutputEncoding = Encoding.UTF8;

            typeof(Program).Assembly.PrintWelcomeToConsole();

            try
            {
                var commands = ConsoleCommandDispatcher.FindCommandsInAssembly(Assembly.GetExecutingAssembly());
                return(ConsoleCommandDispatcher.DispatchCommand(commands, args, Console.Out));
            }
            catch (Exception ex)
            {
                Console.WriteLine(@"Unhandled exception: {0}", ex);
                return(-1);
            }
        }