Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            StringDictionary context = CliParser.parse(args);
            FileSystemWrapper fsw = new FileSystemWrapper();

            IRunnable command = getNewCommand(context, fsw);
            command.run();

            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
Exemplo n.º 2
0
 static IRunnable getNewCommand(StringDictionary context, FileSystemWrapper fsw)
 {
     switch (context["command"]) {
         case "open":
             return new OpenCommand(context, fsw);
         case "close":
             return new CloseCommand(context, fsw);
         case "help":
             return new HelpCommand();
         default:
             throw new NotImplementedException();
     }
 }
Exemplo n.º 3
0
 public CloseCommand(StringDictionary context, FileSystemWrapper fsw)
 {
     _context = context;
     _fsw = fsw;
 }