public CalculatorReplLoop()
 {
     commandInputParser = new CommandInputParserService();
     calculator         = new Calculator();
     inputService       = new InputService();
     outputService      = new OutputService();
 }
예제 #2
0
 public CalculatorReplLoop(ICalculator calculator, IInputService inputService, IOutputService outputService, IInputParserService parsingService)
 {
     this.calculator = calculator;
     this.inputService = inputService;
     this.outputService = outputService;
     this.parsingService = parsingService;
 }
 public CalculatorReplLoop(IInputParserService commandInputParser,
                           ICalculator calculator, IInputService inputService, IOutputService outputService)
 {
     this.commandInputParser = commandInputParser;
     this.calculator         = calculator;
     this.inputService       = inputService;
     this.outputService      = outputService;
 }
 public BootStraper()
 {
     inputService      = new ConsoleInputService();
     outputService     = new ConsoleOutputService();
     inputParse        = new FirstInputeParser();
     car               = new Car1();
     renderCarCommands = new RenderCarCommands();
 }
예제 #5
0
        public CalculatorReplLoop(IServiceLocator locator, ICalculator calculator,
                                  IInputService inputService, IInputParserService parsingService)
        {
            this.calculator     = calculator;
            this.inputService   = inputService;
            this.parsingService = parsingService;

            outputServices = new List <IOutputService>(locator.GetAllInstances <IOutputService>());
        }
 public InventoryDialogService(IUserDataStorage storage, IInputParserService parser, IResultCache resultCache, IInventoryEmailService emailService)
 {
     _services = new Services
     {
         Storage      = storage,
         Parser       = parser,
         ResultCache  = resultCache,
         EmailService = emailService
     };
 }
예제 #7
0
 public CalculatorReplLoop(ICalculator calculator, IInputService inputService, IOutputService outputService, IInputParserService parsingService)
 {
     this.calculator     = calculator;
     this.inputService   = inputService;
     this.outputService  = outputService;
     this.parsingService = parsingService;
 }
예제 #8
0
 private void SetupInputParser(IInputParserService inputParser)
 {
     char[] operatorArray = new char[] { '+', '-', '*', '/' };
     inputParser.SetOperatorsToSeperate(operatorArray);
 }
 public InventoryDialogService(IInventoryStorage storage, IInputParserService parser, ICommandCache commandCache)
 {
     this.storage      = storage;
     this.parser       = parser;
     this.commandCache = commandCache;
 }
        public CarBootStraper(IUnityContainer container)
        {
            this.Container = container;
            List <IOutputService> outputServices = container.ResolveAll <IOutputService>().ToList();

            if (container.IsRegistered <IOutputService>())
            {
                defaultOutPutService = container.Resolve <IOutputService>();
            }
            else
            {
                defaultOutPutService = new ConsoleOutputService();
            }
            SetOutputService(outputServices, defaultOutPutService);

            if (container.IsRegistered <IInputService>())
            {
                inputService = container.Resolve <IInputService>();
            }
            else
            {
                inputService = new ConsoleInputService(outPutService);
            }

            if (container.IsRegistered <IOutputService>())
            {
                outPutService = container.Resolve <IOutputService>();
            }
            else
            {
                outPutService = new ConsoleOutputService();
            }


            if (container.IsRegistered <IInputParserService>())
            {
                inputParser = container.Resolve <IInputParserService>();
            }
            else
            {
                inputParser = new FirstInputeParser();
            }


            if (container.IsRegistered <ICar>())
            {
                car = container.Resolve <ICar>();
            }
            else
            {
                car = new Car();
            }

            if (container.IsRegistered <IRenderCarCommands>())
            {
                renderCarCommands = container.Resolve <IRenderCarCommands>();
            }
            else
            {
                renderCarCommands = new RenderCarCommands(Container);
            }
        }