예제 #1
0
 public void Run()
 {
     writer.WriteLine("Program started");
     while (true)
     {
         try
         {
             string      input       = reader.ReadLine();
             string[]    data        = input.Split();
             string      commandName = data[0];
             IExecutable command     = this.commandDispatcher.DispatchCommand(commandName, data);
             string      result      = command.Execute();
             command.CommitChanges();
             writer.WriteLine(result);
         }
         catch (Exception e)
         {
             writer.WriteLine(e.Message);
         }
     }
 }