コード例 #1
1
 public static void Register(HttpConfiguration configuration)
 {
     container = new WindsorContainer();
     container.Install(FromAssembly.This());
     container.Kernel.Resolver.AddSubResolver(new CollectionResolver(container.Kernel, true));
     configuration.Services.Replace(typeof (IHttpControllerActivator), new WindsorCompositionRoot(container));
 }
コード例 #2
0
        public WindsorDependencyResolver(IWindsorContainer container)
        {
            if (container == null)
                throw new ArgumentNullException("container");

            this.container = container;
        }
コード例 #3
0
        public WindsorControllerFactory(IWindsorContainer container)
        {
            if (container == null)
                throw new ArgumentNullException("container");

            this.container = container;
        }
コード例 #4
0
 private static void AddCustomRepositoriesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes.Pick()
         .FromAssemblyNamed("Anuncios.Data")
         .WithService.FirstNonGenericCoreInterface("Anuncios.Core"));
 }
コード例 #5
0
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.Register(Classes.FromThisAssembly()
                                .BasedOn<IController>()
                                .LifestyleTransient());

            container.Register(Component
                                .For<IControllerFactory>()
                                .UsingFactoryMethod(_ => new WindsorControllerFactory(container))
                                .LifeStyle.Singleton);

            container.Register(Component.For<IRdfTranslator>()
                                .UsingFactoryMethod(_ => new RdfTranslator(container.Resolve<IMongoDataContextProvider>()))
                                .LifeStyle.PerWebRequest);

            container.Register(Component.For<IMongoDataContextProvider>()
                                .UsingFactoryMethod(_ => new MongoDataContextProvider())
                                .LifeStyle.PerWebRequest);

            //container.Register(Component.For<IFormsAuthenticationService>()
            //                    .UsingFactoryMethod(_ => new FormsAuthenticationService())
            //                    .LifeStyle.PerWebRequest);

            //container.Register(Component.For<IMembershipService>()
            //                    .UsingFactoryMethod(_ => new AccountMembershipService())
            //                    .LifeStyle.PerWebRequest);
        }
コード例 #6
0
        public static void AddComponentsTo(IWindsorContainer container)
        {
            AddGenericRepositoriesTo(container);

            container.Register(Component.For<IValidator>().ImplementedBy<Validator>().Named("validator"));
            container.Register(Component.For<IDbContext>().ImplementedBy<DbContext>().Named("dbContext"));
        }
コード例 #7
0
ファイル: ContainerInit.cs プロジェクト: jladuval/MyPlace
 private static void AddResolversAndFacilities(IWindsorContainer container)
 {
     container.Kernel.Resolver.AddSubResolver(new CachingSessionResolver());
     container.Kernel.Resolver.AddSubResolver(new ArrayResolver(container.Kernel));
     container.AddFacility<TypedFactoryFacility>();
     container.AddFacility<StartableFacility>();
 }
コード例 #8
0
 private static void AddApplicationServicesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes.Pick()
         .FromAssemblyNamed("Anuncios.ApplicationServices")
         .WithService.FirstInterface());
 }
コード例 #9
0
        static void CreateTestData(IWindsorContainer container)
        {
            //Test data generation
            var stg = container.Resolve<IGuestBookDataProvider>();

            Task.WaitAll(new Task[]
            {
                stg.AddUser("user1", "Aleksey Fedorov"),
                stg.AddUser("user2", "Pavel Potapov"),
                stg.AddMessage("user2", "Test msg 1"),
                stg.AddMessage("user2", "Test msg 2"),
                stg.AddMessage("user2", "Test msg 3"),
                stg.AddMessage("user1", "Test msg 11"),
                stg.AddMessage("user1", "Test msg 21"),

                stg.AddMessage("user3", "Test msg 31"),

                stg.AddUser("user4", "Ivan Petrov")
            });

            var users = stg.GetUsers(1, 5).Result;
            foreach (var u in users.Items)
                _logger.Info($"{u.UserLogin} - {u.DisplayName}");

            var messages = stg.GetUserMessages("user2", 1, 5).Result;
            foreach (var m in messages.Items)
                _logger.Info($"{m.Text} - {m.Created}");
        }
コード例 #10
0
 public void Install(IWindsorContainer container)
 {
     container.Register(
         Component.For<IAuthenticationUserViewUserService>().ImplementedBy<AuthenticationUserViewUserService>().LifeStyle.PerThread,
         Component.For<IAuthenticationUserViewRoleService>().ImplementedBy<AuthenticationUserViewRoleService>().LifeStyle.PerThread
     );
 }
コード例 #11
0
ファイル: BatchJob.cs プロジェクト: Novthirteen/yfkey-scms
        protected override void OnStart(string[] args)
        {
            try
            {
                log.Info("BatchJob Service Start");
                container = new WindsorContainer(new XmlInterpreter(new ConfigResource("castle")));

                timer = new System.Timers.Timer();
                timer.Interval = Convert.ToDouble(TimerHelper.GetInterval(Settings.Default.IntervalType, 1));
                timer.Enabled = true;
                timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);

                leanEngineTimer = new System.Timers.Timer();
                leanEngineTimer.Interval = Convert.ToDouble(TimerHelper.GetInterval(Settings.Default.IntervalType, 1));
                leanEngineTimer.Enabled = true;
                leanEngineTimer.Elapsed += new System.Timers.ElapsedEventHandler(leanEngineTimer_Elapsed);

                receiveWOTimer = new System.Timers.Timer();
                receiveWOTimer.Interval = Convert.ToDouble(TimerHelper.GetInterval(Settings.Default.IntervalType, 1));
                receiveWOTimer.Enabled = true;
                receiveWOTimer.Elapsed += new System.Timers.ElapsedEventHandler(receiveWOTimer_Elapsed);
            }
            catch (Exception ex)
            {
                log.Error("BatchJob Service Start Failure", ex);
            }
        }
コード例 #12
0
        /// <summary>
        /// http://trac.caffeine-it.com/openrasta/ticket/118#comment:1
        /// See OpenRasta.DigestAuthorizerContributor.WriteCredentialRequest
        /// TODO: Need to implement 
        /// </summary>
        public static void RemoveDigestAuthorisationContributor(IWindsorContainer container)
        {
            var contributors = container.Kernel.GetHandlers(typeof(IPipelineContributor));
            var digestContributor = contributors.SingleOrDefault(i => i.ComponentModel.Implementation == typeof(DigestAuthorizerContributor));

            container.Kernel.RemoveComponent(digestContributor.ComponentModel.Name);
        }
コード例 #13
0
 public void Install(IWindsorContainer container)
 {
     container.Register(
         AllTypes.FromThisAssembly().BasedOn<IEmailTemplateManagementDatabaseFactory>().Configure(
             component =>
             {
                 component.Named(component.Implementation.Name);
                 component.LifeStyle.Is(LifestyleType.Thread);
             }).WithService.Base(),
         AllTypes.FromThisAssembly().BasedOn<IEmailTemplateManagementUnitOfWork>().Configure(
             component =>
             {
                 component.Named(component.Implementation.Name);
                 component.LifeStyle.Is(LifestyleType.Thread);
             }).WithService.Base(),
         AllTypes.FromThisAssembly().BasedOn<IEmailTemplateManagementTemplateRepository>().Configure(
             component =>
             {
                 component.Named(component.Implementation.Name);
                 component.LifeStyle.Is(LifestyleType.Thread);
             }).WithService.Base(),
         AllTypes.FromThisAssembly().BasedOn<IProvideEmailTemplateManagementSessionFactoryInitialisation>().Configure(
             component =>
             {
                 component.Named(component.Implementation.Name);
                 component.LifeStyle.Is(LifestyleType.Thread);
             }).WithService.Base()
     );
 }
		public Will_send_invalid_admin_message_to_error_queue()
		{
			container = new WindsorContainer(new XmlInterpreter());
            new RhinoServiceBusConfiguration()
                .UseCastleWindsor(container)
                .Configure();
		}
コード例 #15
0
        static void Main(string[] args)
        {
            container = BotRunnerBootstrapper.Init();

            var fineBot = new Bot();
            var fineBotResponders = container.ResolveAll<IFineBotResponder>();
            foreach (IFineBotResponder responder in fineBotResponders)
            {
                fineBot.Responders.Add(responder);
            }

            fineBot.RespondsTo("hi").IfBotIsMentioned().With("Stop resisting citizen!");
            fineBot.CreateResponder(x => !x.BotHasResponded, rc => "My responses are limited, you must ask the right question...");

            var task = fineBot.Connect(ConfigurationManager.AppSettings["BotKey"]);
            Console.WriteLine(string.Format("{0}: Bot is runnning, type 'die' to make it die", DateTime.Now));

            var secondCousinBot = new Bot();
            var secondCousinResponders = container.ResolveAll<ISecondCousinResponder>();
            foreach (ISecondCousinResponder responder in secondCousinResponders)
            {
                secondCousinBot.Responders.Add(responder);
            }
            var seconderTask = secondCousinBot.Connect(ConfigurationManager.AppSettings["SeconderBotKey"]);
            Console.WriteLine(string.Format("{0}: Finebot's second cousin is also also running. Some say he can't die.", DateTime.Now));

            while(Console.ReadLine() != "die")
            {

            }

            container.Dispose();
        }
コード例 #16
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("SharpArchTemplate.Web.Mvc")
             .InNamespace("SharpArchTemplate.Web.Mvc.Controllers.Queries", true)
             .WithService.DefaultInterfaces());
 }
コード例 #17
0
ファイル: WindsorInstaller.cs プロジェクト: nslowes/EasyNetQ
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     Console.WriteLine("Running installer for SimpleSaga");
     container.Register(
         Component.For<ISaga>().ImplementedBy<TestSaga>().LifeStyle.Singleton
         );
 }
コード例 #18
0
        private static void AddGenericRepositoriesTo(IWindsorContainer container)
        {
            container.Register(
                    Component
                        .For(typeof(IEntityDuplicateChecker))
                        .ImplementedBy(typeof(EntityDuplicateChecker))
                        .Named("entityDuplicateChecker"));

            container.Register(
                    Component
                        .For(typeof(IRepository<>))
                        .ImplementedBy(typeof(Repository<>))
                        .Named("repositoryType"));

            container.Register(
                    Component
                        .For(typeof(INHibernateRepository<>))
                        .ImplementedBy(typeof(NHibernateRepository<>))
                        .Named("nhibernateRepositoryType"));

            container.Register(
                    Component
                        .For(typeof(IRepositoryWithTypedId<,>))
                        .ImplementedBy(typeof(RepositoryWithTypedId<,>))
                        .Named("repositoryWithTypedId"));

            container.Register(
                    Component
                        .For(typeof(INHibernateRepositoryWithTypedId<,>))
                        .ImplementedBy(typeof(NHibernateRepositoryWithTypedId<,>))
                        .Named("nhibernateRepositoryWithTypedId"));
        }
コード例 #19
0
		public WindsorContext()
		{
			container = new WindsorContainer()
				.AddFacility<EventBrokerFacility>()
				.Install(new FormsInstaller());
			MainForm = container.Resolve<ApplicationShell>();
		}
コード例 #20
0
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.Register(Component
                .For<IDatabaseContext>()
                .ImplementedBy<DatabaseContext>()
                .DependsOn(Dependency.OnValue("nameOrConnectionString", "DefaultConnection"))
                .LifeStyle.Transient
                );

            container.Register(Component
                .For<IUserStore>()
                .ImplementedBy<UserStore>()
                .LifeStyle.Transient);

            container.Register(Component
                .For<IPostStore>()
                .ImplementedBy<PostStore>()
                .LifeStyle.Transient
                );

            container.Register(Component
                .For<IUnitOfWork>()
                .ImplementedBy<UnitOfWork>()
                .LifeStyle.Transient
                );
        }
コード例 #21
0
        public DailyGrossRepositoryTest()
        {
            System.Configuration.ConnectionStringSettings cs = System.Configuration.ConfigurationManager.ConnectionStrings["aps"];

            _container = new WindsorContainer();
            _container
                .Register(Component.For<IDatabase>()
                    .ImplementedBy<Database>()
                    .DependsOn(Dependency.OnValue("provider", cs.ProviderName))
                    .DependsOn(Dependency.OnValue("connectionString", cs.ConnectionString))
                    //.DependsOn(Dependency.OnValue("provider", "System.Data.SqlClient"))
                    //.DependsOn(Dependency.OnValue("connectionString", "Data Source=dev-s01;Initial Catalog=aps;User ID=sa;Password=sql@dm1n"))
                )
                .Register(Component.For<IDailyGrossRepository>()
                    .ImplementedBy<DailyGrossRepository>()
                );

            _now = DateTime.Now;
            _ww = _now.WorkWeek();
            _db = _container.Resolve<IDatabase>();
            TestHelpers.TestData.Reset(_db);
            _employee = TestHelpers.TestData.GetEmployee(_db, "Tom");            

            _repos = _container.Resolve<IDailyGrossRepository>();
        }
コード例 #22
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(Component.For<IMainWindow, IInvokable>().ImplementedBy<MainWindow>().LifeStyle.Singleton);
     container.Register(Component.For<ISystemNotification>().ImplementedBy<SystemNotification>().LifeStyle.Singleton);
     container.Register(Component.For<IGameDetailView>().ImplementedBy<GameDetailControl>().LifeStyle.Transient);
     container.Register (Component.For<IActiveSessionView> ().ImplementedBy<ActiveSessionControl> ().LifeStyle.Transient);
 }
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(
         Component.For<IConfigureWiringForTests, IResetTestDatabases>()
             .Instance(new DocumentDbTestConfigurer(container))
         );
 }
コード例 #24
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(
         Classes.FromThisAssembly().BasedOn<IInitialiser>().WithService.FromInterface(),
         Component.For<IList<IInitialiser>>().UsingFactoryMethod<List<IInitialiser>>(
             c => new List<IInitialiser>(c.ResolveAll<IInitialiser>())));
 }
コード例 #25
0
        /// <summary>
        /// Performs the installation in the <see cref="T:Castle.Windsor.IWindsorContainer" />.
        /// </summary>
        /// <param name="container">The container.</param>
        /// <param name="store">The configuration store.</param>
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.AddFacility<LoggingFacility>(f => f.UseLog4Net());
            container.Register(
                Component.For<IRepository>()
                    .ImplementedBy<GenericRepository>()
                    .DependsOn(
                        Dependency.OnValue("connectionString", ConfigurationManager.ConnectionStrings["MongoDB"].ConnectionString),
                        Dependency.OnAppSettingsValue("databaseName", "DbName")),

                Component.For<IFoodProcessor>()
                    .ImplementedBy<FoodProcessor>(),

                Component.For<IBoardProcessor>()
                    .ImplementedBy<BoardProcessor>()
                    .DynamicParameters((DynamicParametersDelegate)GetBoardTemplates),

                Component.For<BoardTemplate>()
                    .ImplementedBy<DailyMenuBoardTemplate>()
                    .Named("DailyMenuBoardTemplate"),

                Component.For<BoardTemplate>()
                    .ImplementedBy<SalatsBoardTemplate>()
                    .Named("SalatsBoardTemplate"));
        }
コード例 #26
0
        private static void BootstrapContainer()
        {
            container = new WindsorContainer().Install(FromAssembly.This());

            var controllerFactory = new WindsorControllerFactory(container.Kernel);
            ControllerBuilder.Current.SetControllerFactory(controllerFactory);
        }
コード例 #27
0
ファイル: AutoMapper.cs プロジェクト: adalbertus/BaseMVC
        public static void Configure(IWindsorContainer container)
        {
            Mapper.Initialize(x => x.ConstructServicesUsing(type => ResolveType(container, type)));

            Mapper.CreateMap<User, UserListItemViewModel>();

            Mapper.CreateMap<Task, TaskListItemViewModel>();
            Mapper.CreateMap<Task, TaskInputViewModel>()
                .ForMember(m => m.AvaiableProjects, opt => opt.ResolveUsing<AvaiableProductsResolver>().FromMember(x => x.Owner.Id));

            Mapper.CreateMap<TaskInputViewModel, Task>()
                .ForMember(m => m.Owner, o => o.ResolveUsing<LoadingEntityResolver<User>>().FromMember(x => x.OwnerId))
                .ForMember(m => m.Project, o => o.ResolveUsing<LoadingEntityResolver<Project>>().FromMember(x => x.ProjectId));

            Mapper.CreateMap<Project, ProjectListItemViewModel>();
            Mapper.CreateMap<Project, ProjectViewModel>();
            Mapper.CreateMap<Project, ProjectInputViewModel>()
                .ForMember(m => m.SelectedOwnerId, o => o.MapFrom(x => x.Owner.Id))
                .ForMember(m => m.SelectedParticipants, o => o.MapFrom(x => x.Participants.Select(p => p.Id)))
                .ForMember(m => m.AvaiableOwners, opt => opt.ResolveUsing<AvaiableProductOwnersResolver>())
                .ForMember(m => m.AvaiableParticipants, opt => opt.ResolveUsing<AvaiableProductOwnersResolver>());

            Mapper.CreateMap<ProjectInputViewModel, Project>()
                .ForMember(m => m.Owner, o => o.ResolveUsing<LoadingEntityResolver<User>>().FromMember(x => x.SelectedOwnerId))
                .ForMember(dst => dst.Participants, opt => opt.ResolveUsing<LoadingCollectionEntityResolver<User>>().FromMember(x => x.SelectedParticipants))
                .ForMember(dst => dst.Tasks, opt => opt.Ignore());
        }
コード例 #28
0
        private static void ConfigMetadata(IModelRegistrar reg, IWindsorContainer container)
        {
            reg.ModelNamespacePattern("Centros.Model.{0}, Centros.Model");
            reg.RegisterPatterApplier(new IdPatternApplier { IdPropertyName = "Id" });
            reg.RegisterPatterApplier(new ReferencePatternApplier { ExcludeReferenceTypes = new[] { typeof(Horario) } });
            reg.DomainAccessorAccessor(modelType =>
                                       	{
                                       		var providerType = typeof (IDomainAccessor<>).MakeGenericType(modelType);
                                       		return (IDomainAccessor<object>) container.Resolve(providerType);
                                       	}).
                DomainMutatorAccessor(modelType =>
                                      	{
                                      		var providerType = typeof (IDomainMutator<>).MakeGenericType(modelType);
                                      		return (IDomainMutator<object>) container.Resolve(providerType);
                                      	});

            reg.ForType<Centro>();
            reg.ForType<Educador>();
            reg.ForType<Horario>();
            reg.ForType<Institucion>(md => md.Description("Institución"));
            reg.ForType<Jurisdiccion>(md => md.Description("Jurisdicción"));
            reg.ForType<Organizacion>(md => md.Description("Organización"));
            reg.ForType<Participacion>();
            reg.ForType<Participante>();
            reg.ForType<Registro>();
            reg.ForType<Taller>();
        }
コード例 #29
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(
        Component.For(typeof (ICustomWindowManager), typeof (IWindowManager)).ImplementedBy<CustomWindowManager>().LifeStyle.Is(LifestyleType.Singleton),
        Component.For<IEventAggregator>().ImplementedBy<EventAggregator>().LifeStyle.Is(LifestyleType.Singleton)
        );
 }
コード例 #30
0
 public void Install(IWindsorContainer container)
 {
     container.Register(
         Component.For<ILoginUserService>().ImplementedBy<LoginUserService>().LifeStyle.PerWebRequest,
         Component.For<ILoginRoleService>().ImplementedBy<LoginRoleService>().LifeStyle.PerWebRequest
     );
 }
コード例 #31
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(Castle.MicroKernel.Registration.Component.For(typeof(IFoo)).ImplementedBy(typeof(Foo)));
 }
コード例 #32
0
 public static void Init(IWindsorContainer container)
 {
     _container = container;
 }
コード例 #33
0
 public WindsorContainerRegistrar(IWindsorContainer container)
 {
     _container = container;
 }
コード例 #34
0
        public bool Start(string sdkConnectionString, string serviceLocation)
        {
            Console.WriteLine("ServiceMonitoringPlugin start called");
            try
            {
                string dbNameSection;
                string dbPrefix;
                if (sdkConnectionString.ToLower().Contains("convert zero datetime"))
                {
                    dbNameSection = Regex.Match(sdkConnectionString, @"(Database=\w*;)").Groups[0].Value;
                    dbPrefix      = Regex.Match(sdkConnectionString, @"Database=(\d*)_").Groups[1].Value;
                }
                else
                {
                    dbNameSection = Regex.Match(sdkConnectionString, @"(Initial Catalog=\w*;)").Groups[0].Value;
                    dbPrefix      = Regex.Match(sdkConnectionString, @"Initial Catalog=(\d*)_").Groups[1].Value;
                }


                var pluginDbName     = $"Initial Catalog={dbPrefix}_eform-angular-monitoring-plugin;";
                var connectionString = sdkConnectionString.Replace(dbNameSection, pluginDbName);


                if (!_coreAvailable && !_coreStatChanging)
                {
                    _serviceLocation  = serviceLocation;
                    _coreStatChanging = true;

                    if (string.IsNullOrEmpty(_serviceLocation))
                    {
                        throw new ArgumentException("serviceLocation is not allowed to be null or empty");
                    }

                    if (string.IsNullOrEmpty(connectionString))
                    {
                        throw new ArgumentException("serverConnectionString is not allowed to be null or empty");
                    }

                    EformMonitoringPnDbContextFactory contextFactory = new EformMonitoringPnDbContextFactory();

                    _dbContext = contextFactory.CreateDbContext(new[] { connectionString });
                    _dbContext.Database.Migrate();

                    _coreAvailable    = true;
                    _coreStatChanging = false;

                    StartSdkCoreSqlOnly(sdkConnectionString);

                    _container = new WindsorContainer();
                    _container.Register(Component.For <IWindsorContainer>().Instance(_container));
                    _container.Register(Component.For <EformMonitoringPnDbContext>().Instance(_dbContext));
                    _container.Register(Component.For <eFormCore.Core>().Instance(_sdkCore));
                    _container.Install(
                        new RebusHandlerInstaller()
                        , new RebusInstaller(connectionString, MaxParallelism, NumberOfWorkers)
                        );

                    _bus = _container.Resolve <IBus>();
                }
                Console.WriteLine("ServiceMonitoringPlugin started");
                return(true);
            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.DarkRed;
                Console.WriteLine("Start failed " + ex.Message);
                throw;
            }
        }
コード例 #35
0
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            RegisterCommandHandlers(container, _descriptor);

            RegisterEventHandlers(container, _descriptor);
        }
コード例 #36
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(Classes.FromThisAssembly()
                        .BasedOn <IController>()
                        .LifestyleTransient());
 }
コード例 #37
0
 public WindsorControllerFactory(IWindsorContainer container)
 {
     _container = container;
 }
 public ScopedWindsorServiceProvider(IWindsorContainer container, MsLifetimeScopeProvider msLifetimeScopeProvider)
 {
     _container          = container;
     _ownMsLifetimeScope = msLifetimeScopeProvider.LifetimeScope;
 }
コード例 #39
0
 private void RegisterRoutes(IWindsorContainer container)
 {
     container.Register(Component.For <IRouteConfiguration>().ImplementedBy <ChangeQueriesRouteConfiguration>());
 }
コード例 #40
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(Classes.FromThisAssembly()
                        .Where(type => type.Name.EndsWith("View"))
                        .Configure(c => c.LifeStyle.Is(LifestyleType.Singleton)));
 }
コード例 #41
0
        private void InstallEnterpriseSpecificServices(IWindsorContainer container)
        {
            container.Register(Component.For <IGetCloudOdsInstanceQuery>()
                               .ImplementedBy <GetAwsCloudOdsInstanceQuery>()
                               .LifestyleTransient());

            container.Register(Component.For <IGetCloudOdsApiWebsiteSettingsQuery>()
                               .ImplementedBy <GetAwsCloudOdsApiWebsiteSettingsQuery>()
                               .LifestyleTransient());

            container.Register(Component.For <IUpdateCloudOdsApiWebsiteSettingsCommand>()
                               .ImplementedBy <UpdateAwsCloudOdsApiWebsiteSettingsCommand>()
                               .LifestyleTransient());

            container.Register(Component.For <ICloudOdsProductionLifecycleManagementService>()
                               .ImplementedBy <AwsProductionLifecycleManagementService>()
                               .LifestyleTransient());

            container.Register(Component.For <IGetProductionApiProvisioningWarningsQuery>()
                               .ImplementedBy <GetAwsProductionApiProvisionWarningQuery>()
                               .LifestyleTransient());

            container.Register(Component.For <ICompleteOdsPostUpdateSetupCommand>()
                               .ImplementedBy <CompleteAwsOdsPostUpdateSetupCommand>()
                               .LifestyleTransient());

            container.Register(Component.For <IRestartAppServicesCommand>()
                               .ImplementedBy <RestartAwsAppServicesCommand>()
                               .LifestyleTransient());

            container.Register(Component.For <IGetCloudOdsHostedComponentsQuery>()
                               .ImplementedBy <LocalFileBasedGetCloudOdsHostedComponentsQuery>()
                               .LifestyleTransient());

            container.Register(Component.For <IFirstTimeSetupService>()
                               .ImplementedBy <AwsFirstTimeSetupService>()
                               .LifestyleTransient());

            container.Register(Component.For <ICloudOdsDatabaseSqlServerSecurityConfiguration>()
                               .ImplementedBy <AwsCloudOdsDatabaseSqlServerSecurityConfiguration>()
                               .LifestyleTransient());

            container.Register(Component.For <ICloudOdsDatabaseNameProvider>()
                               .ImplementedBy <AwsCloudOdsDatabaseNameProvider>()
                               .LifestyleTransient());

            container.Register(Component.For <IStringEncryptorService>()
                               .ImplementedBy <StringEncryptorService>()
                               .LifestyleTransient());

            container.Register(Component.For <ITabDisplayService>()
                               .ImplementedBy <AwsTabDisplayService>()
                               .LifestyleTransient());

            container.Register(Component.For <IHomeScreenDisplayService>()
                               .ImplementedBy <AwsHomeScreenDisplayService>()
                               .LifestyleTransient());

            container.Register(
                Component.For <ICompleteOdsFirstTimeSetupCommand>()
                .ImplementedBy <CompleteOdsFirstTimeSetupCommand>()
                .LifestyleTransient());
        }
コード例 #42
0
        public static void RegisterDataAccess(this IWindsorContainer container, string assemblyName)
        {
            Guard.AgainstNull(container, "container");

            container.RegisterDataAccess(Assembly.Load(assemblyName));
        }
コード例 #43
0
 public static void SetContainer(IWindsorContainer container)
 {
     _maintContainer = container;
 }
コード例 #44
0
 void IWindsorInstaller.Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(Classes.FromAssemblyContaining <AddOperationStrategy>().BasedOn <IOperationStrategy>().WithService.Self());
     container.Register(Classes.FromAssemblyContaining <AddOperationStrategy>().BasedOn <IOperationStrategySpecification>().WithServiceAllInterfaces());
 }
コード例 #45
0
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.AddFacility <TypedFactoryFacility>();

            container.Register(
                Classes
                .FromThisAssembly()
                .BasedOn(typeof(ISettingsRepository <>))
                .WithServiceAllInterfaces()
                .LifestyleTransient()
                );

            container.Register(
                Component
                .For <IMT5Api>()
                .ImplementedBy <MT5Api>()
                .LifestyleTransient()
                );

            container.Register(
                Component
                .For <ITradingWatchdog>()
                .ImplementedBy <Watchdog.TradingWatchdog>()
                .LifestyleTransient()
                );

            container.Register(
                Component
                .For <ITradesMonitor>()
                .ImplementedBy <TradesMonitor>()
                .LifestyleSingleton()
                );

            container.Register(
                Component
                .For <ITradeValidator>()
                .ImplementedBy <TradeValidator>()
                .LifestyleSingleton()
                );

            container.Register(
                Component
                .For <ITradingServerListener>()
                .ImplementedBy <TradingServerListener>()
                .LifestyleTransient()
                );

            container.Register(
                Component
                .For <ITradingServerListenerFactory>()
                .AsFactory()
                );

            container.Register(
                Component
                .For <ILogger>()
                .ImplementedBy <FileLogger>()
                .LifestyleSingleton()
                );

            container.Register(
                Component
                .For <ILogEntryFormatter>()
                .ImplementedBy <JsonLogEntryFormatter>()
                .LifestyleSingleton()
                );
        }
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     //container.Register(Classes.FromAssemblyNamed("Example.Library").BasedOn<IController>().LifestyleTransient());
 }
コード例 #47
0
 public void Init()
 {
     container = new WindsorContainer();
 }
コード例 #48
0
 /// <summary>
 /// Returns service provider wrapping Castle Windsor container.
 /// </summary>
 public static IServiceProvider AddCustomizedServiceProvider(this IServiceCollection services, IWindsorContainer container)
 {
     return(WindsorRegistrationHelper.CreateServiceProvider(container, services));
 }
コード例 #49
0
 public static void RegisterAll(this IWindsorContainer container)
 {
     container.Kernel.Resolver.AddSubResolver(new CollectionResolver(container.Kernel, true));
     container.Register(Component.For <IWindsorContainer>().UsingFactoryMethod(() => container).LifestyleSingleton());
     container.Install(FromAssembly.InDirectory(new AssemblyFilter(AppDomain.CurrentDomain.BaseDirectory), new WindsorPriorityBootstrap()));
 }
コード例 #50
0
 public static void AddComponentsTo(IWindsorContainer container)
 {
     AddGenericRepositoriesTo(container);
     AddCustomRepositoriesTo(container);
     AddWcfServiceFactoriesTo(container);
 }
コード例 #51
0
ファイル: KanaContainer.cs プロジェクト: rlucassen/kana
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
 }
コード例 #52
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(Component.For(typeof(Foo)));
 }
コード例 #53
0
 public ContextFactory(IWindsorContainer container)
 {
     _container = container;
 }
コード例 #54
0
 public IoCInitializer(IWindsorContainer windsorContainer)
 {
     _container = windsorContainer;
     _container.Kernel.ComponentRegistered += Kernel_ComponentRegistered;
 }
コード例 #55
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(AllTypes.FromThisAssembly().InSameNamespaceAs <OrdersController>()
                        .LifestyleTransient());
 }
コード例 #56
0
ファイル: KanaContainer.cs プロジェクト: rlucassen/kana
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.AddFacility <LoggingFacility>(f => f.UseLog4Net());
 }
コード例 #57
0
 protected override void InstallHostingSpecificClasses(IWindsorContainer container)
 {
     InstallEnterpriseSpecificServices(container);
 }
コード例 #58
0
 protected virtual void RegisterResourceModelHelper(IWindsorContainer container)
 {
     ResourceModelHelper.ResourceModel =
         new Lazy <ResourceModel>(() => container.Resolve <IResourceModelProvider>().GetResourceModel());
 }
コード例 #59
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(
         Component.For <IVehicleRepository>().ImplementedBy <VehicleRepository>().LifestylePerWebRequest());
 }
コード例 #60
0
 public CastleServiceLocator(IWindsorContainer container)
 {
     this.container = container;
 }