Ejemplo n.º 1
0
        static void Main()
        {
            commandFactory = new CommandFactory();
            log = new ConsoleWindowLogger();
            commandHandler = new CommandHandler(commandFactory, log);

            Console.WindowHeight = 40;
            Console.WindowWidth = 120;

            PrintHelp();

            while (true)
            {
                Thread.Sleep(300);
                Console.Write("> ");

                var line = Console.ReadLine();

                if (string.IsNullOrWhiteSpace(line))
                {
                    continue;
                }

                var split = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

                commandHandler.TryHandleRequest(split);

                Console.WriteLine();
            }
        }
Ejemplo n.º 2
0
 static Environment()
 {
     DataStore = new InMemoryDataStore();
     Logger = new ConsoleWindowLogger();
     CommandFactory = new CommandFactory();
 }