Beispiel #1
0
        public static UnityContainer BuildContainer()
        {
            var container = new UnityContainer();

            container.RegisterType <PositionState>(new ContainerControlledLifetimeManager(), new InjectionConstructor());
            container.RegisterType <Tracker>(new ContainerControlledLifetimeManager(), new InjectionConstructor(typeof(PositionState)));
            container.RegisterType <IInstructionExecutor, InstructionExecutor>();
            container.RegisterType <IBackOffStrategiesExecutor, BackOffStrategiesExecutor>();
            container.RegisterType <IBackOffInstructionsInitializer, StandardBackOffInstructionsInitializer>();
            container.RegisterType <IWorkParametersProvider, ReadingInput>();
            container.RegisterType <IFileWriter, FileWriter>();
            container.RegisterType <IMachineCleaner, Robot>();

            var backOffSettings = new BackOffSettings();

            backOffSettings.Strategies = AppSettings.SafeGet <string>(backOffSettings.BackOffStrategiesTag);
            container.RegisterInstance(backOffSettings);


            return(container);
        }
 public StandardBackOffInstructionsInitializer(BackOffSettings backOffSettings)
 {
     _backOffSettings = backOffSettings;
 }