Пример #1
0
 public void Run()
 {
     while (true)
     {
         try
         {
             string             input          = Console.ReadLine();
             string[]           data           = input.Split();
             CommandInterpreter cmdInterpreter = new CommandInterpreter(this.repository, this.unitFactory);
             IExecutable        currentCommand = cmdInterpreter.InterpretCommand(data, data[0]);
             Console.WriteLine(currentCommand.Execute());
         }
         catch (Exception e)
         {
             Console.WriteLine(e.Message);
         }
     }
 }
Пример #2
0
 public void Run()
 {
     while (true)
     {
         try
         {
             string             input              = Console.ReadLine();
             string[]           data               = input.Split();
             string             commandName        = data[0];
             CommandInterpreter commandInterpreter = new CommandInterpreter(repository, unitFactory);
             var result = commandInterpreter.InterpretCommand(data, commandName);
             Console.WriteLine(result);
         }
         catch (Exception e)
         {
             Console.WriteLine(e.Message);
         }
     }
 }
Пример #3
0
 public Engine(CommandInterpreter interpreter, Dependencies dependencies)
 {
     this.interpreter  = interpreter;
     this.dependencies = dependencies;
 }
Пример #4
0
 public Engine()
 {
     this.commandInterpreter = new CommandInterpreter();
 }
Пример #5
0
 public Engine(CommandInterpreter interpreter)
 {
     this.interpreter = interpreter;
 }
Пример #6
0
 public Engine(IRepository repository, IUnitFactory unitFactory)
 {
     this.repository         = repository;
     this.unitFactory        = unitFactory;
     this.commandInterpreter = new CommandInterpreter(unitFactory, repository);
 }
Пример #7
0
 public Engine(CommandInterpreter commandInterpreter)
 {
     this.commandInterpreter = commandInterpreter;
 }
Пример #8
0
 public Engine(IRepository repository, IUnitFactory unitFactory)
 {
     this.interpreter = new CommandInterpreter(repository, unitFactory);
 }