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)); }
public WindsorDependencyResolver(IWindsorContainer container) { if (container == null) throw new ArgumentNullException("container"); this.container = container; }
public WindsorControllerFactory(IWindsorContainer container) { if (container == null) throw new ArgumentNullException("container"); this.container = container; }
private static void AddCustomRepositoriesTo(IWindsorContainer container) { container.Register( AllTypes.Pick() .FromAssemblyNamed("Anuncios.Data") .WithService.FirstNonGenericCoreInterface("Anuncios.Core")); }
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); }
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")); }
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>(); }
private static void AddApplicationServicesTo(IWindsorContainer container) { container.Register( AllTypes.Pick() .FromAssemblyNamed("Anuncios.ApplicationServices") .WithService.FirstInterface()); }
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}"); }
public void Install(IWindsorContainer container) { container.Register( Component.For<IAuthenticationUserViewUserService>().ImplementedBy<AuthenticationUserViewUserService>().LifeStyle.PerThread, Component.For<IAuthenticationUserViewRoleService>().ImplementedBy<AuthenticationUserViewRoleService>().LifeStyle.PerThread ); }
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); } }
/// <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); }
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(); }
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(); }
public void Install(IWindsorContainer container, IConfigurationStore store) { container.Register( AllTypes.FromAssemblyNamed("SharpArchTemplate.Web.Mvc") .InNamespace("SharpArchTemplate.Web.Mvc.Controllers.Queries", true) .WithService.DefaultInterfaces()); }
public void Install(IWindsorContainer container, IConfigurationStore store) { Console.WriteLine("Running installer for SimpleSaga"); container.Register( Component.For<ISaga>().ImplementedBy<TestSaga>().LifeStyle.Singleton ); }
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")); }
public WindsorContext() { container = new WindsorContainer() .AddFacility<EventBrokerFacility>() .Install(new FormsInstaller()); MainForm = container.Resolve<ApplicationShell>(); }
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 ); }
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>(); }
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)) ); }
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>()))); }
/// <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")); }
private static void BootstrapContainer() { container = new WindsorContainer().Install(FromAssembly.This()); var controllerFactory = new WindsorControllerFactory(container.Kernel); ControllerBuilder.Current.SetControllerFactory(controllerFactory); }
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()); }
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>(); }
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) ); }
public void Install(IWindsorContainer container) { container.Register( Component.For<ILoginUserService>().ImplementedBy<LoginUserService>().LifeStyle.PerWebRequest, Component.For<ILoginRoleService>().ImplementedBy<LoginRoleService>().LifeStyle.PerWebRequest ); }
public void Install(IWindsorContainer container, IConfigurationStore store) { container.Register(Castle.MicroKernel.Registration.Component.For(typeof(IFoo)).ImplementedBy(typeof(Foo))); }
public static void Init(IWindsorContainer container) { _container = container; }
public WindsorContainerRegistrar(IWindsorContainer container) { _container = container; }
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; } }
public void Install(IWindsorContainer container, IConfigurationStore store) { RegisterCommandHandlers(container, _descriptor); RegisterEventHandlers(container, _descriptor); }
public void Install(IWindsorContainer container, IConfigurationStore store) { container.Register(Classes.FromThisAssembly() .BasedOn <IController>() .LifestyleTransient()); }
public WindsorControllerFactory(IWindsorContainer container) { _container = container; }
public ScopedWindsorServiceProvider(IWindsorContainer container, MsLifetimeScopeProvider msLifetimeScopeProvider) { _container = container; _ownMsLifetimeScope = msLifetimeScopeProvider.LifetimeScope; }
private void RegisterRoutes(IWindsorContainer container) { container.Register(Component.For <IRouteConfiguration>().ImplementedBy <ChangeQueriesRouteConfiguration>()); }
public void Install(IWindsorContainer container, IConfigurationStore store) { container.Register(Classes.FromThisAssembly() .Where(type => type.Name.EndsWith("View")) .Configure(c => c.LifeStyle.Is(LifestyleType.Singleton))); }
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()); }
public static void RegisterDataAccess(this IWindsorContainer container, string assemblyName) { Guard.AgainstNull(container, "container"); container.RegisterDataAccess(Assembly.Load(assemblyName)); }
public static void SetContainer(IWindsorContainer container) { _maintContainer = container; }
void IWindsorInstaller.Install(IWindsorContainer container, IConfigurationStore store) { container.Register(Classes.FromAssemblyContaining <AddOperationStrategy>().BasedOn <IOperationStrategy>().WithService.Self()); container.Register(Classes.FromAssemblyContaining <AddOperationStrategy>().BasedOn <IOperationStrategySpecification>().WithServiceAllInterfaces()); }
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()); }
public void Init() { container = new WindsorContainer(); }
/// <summary> /// Returns service provider wrapping Castle Windsor container. /// </summary> public static IServiceProvider AddCustomizedServiceProvider(this IServiceCollection services, IWindsorContainer container) { return(WindsorRegistrationHelper.CreateServiceProvider(container, services)); }
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())); }
public static void AddComponentsTo(IWindsorContainer container) { AddGenericRepositoriesTo(container); AddCustomRepositoriesTo(container); AddWcfServiceFactoriesTo(container); }
public void Install(IWindsorContainer container, IConfigurationStore store) { }
public void Install(IWindsorContainer container, IConfigurationStore store) { container.Register(Component.For(typeof(Foo))); }
public ContextFactory(IWindsorContainer container) { _container = container; }
public IoCInitializer(IWindsorContainer windsorContainer) { _container = windsorContainer; _container.Kernel.ComponentRegistered += Kernel_ComponentRegistered; }
public void Install(IWindsorContainer container, IConfigurationStore store) { container.Register(AllTypes.FromThisAssembly().InSameNamespaceAs <OrdersController>() .LifestyleTransient()); }
public void Install(IWindsorContainer container, IConfigurationStore store) { container.AddFacility <LoggingFacility>(f => f.UseLog4Net()); }
protected override void InstallHostingSpecificClasses(IWindsorContainer container) { InstallEnterpriseSpecificServices(container); }
protected virtual void RegisterResourceModelHelper(IWindsorContainer container) { ResourceModelHelper.ResourceModel = new Lazy <ResourceModel>(() => container.Resolve <IResourceModelProvider>().GetResourceModel()); }
public void Install(IWindsorContainer container, IConfigurationStore store) { container.Register( Component.For <IVehicleRepository>().ImplementedBy <VehicleRepository>().LifestylePerWebRequest()); }
public CastleServiceLocator(IWindsorContainer container) { this.container = container; }