当前位置: 首页>>代码示例>>C#>>正文


C# WindsorContainer.Install方法代码示例

本文整理汇总了C#中WindsorContainer.Install方法的典型用法代码示例。如果您正苦于以下问题:C# WindsorContainer.Install方法的具体用法?C# WindsorContainer.Install怎么用?C# WindsorContainer.Install使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WindsorContainer的用法示例。


在下文中一共展示了WindsorContainer.Install方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IntegrationContainer

        public IntegrationContainer()
        {
            container = new WindsorContainer();

            // allow collection injection
            container.Kernel.Resolver.AddSubResolver(new CollectionResolver(container.Kernel));

            // disable automatic property injection
            container.Kernel.ComponentModelBuilder.RemoveContributor(
                container.Kernel.ComponentModelBuilder.Contributors.OfType<PropertiesDependenciesModelInspector>().Single());

            container.Kernel.AddFacility<TypedFactoryFacility>();

            //selectively install Finance.Service classes
            container.Install(  new MappingsCreatorInstaller()
                                //new MappingsInstaller()
                                );

            //Persistence.EF installers
            container.Install(FromAssembly.Containing<ModelContextFactory>());

            //Core installers
            container.Install(FromAssembly.Containing<AppSettings>());

            //Integration inplememntations
            container.Register(Component.For<IConnection>().ImplementedBy<IntegrationConnection>());
            container.Register(Component.For<IExceptionService>().ImplementedBy<IntegrationExceptionService>());

            //Create all mappings
            container.Resolve<MappingsCreator>();

            DisplayRegistrations();
        }
开发者ID:harriganjames,项目名称:Finances,代码行数:33,代码来源:IntegrationContainer.cs

示例2: AddRegistration

        protected virtual void AddRegistration(WindsorContainer container)
        {
            container.Register(Component.For<ISecurityAssertionProvider>().Instance(new SafeMethodOnlySecurityAssertionProvider()));
            // Use the version of the interceptor that doesn't allow any calls to go through
            // container.Register(Component.For<IInterceptor, ApplyViewPermissionsWithNoProceedInterceptor>());

            IoC.Initialize(container);
            container.Register(
                Component
                    .For(typeof(IMetricActionUrlAuthorizationProvider))
                    .Instance(metricActionUrlAuthService));

            container.Install(new TestConfigurationSpecificInstaller());
            container.Install(new SecurityComponentsInstaller(typeof(ApplyViewPermissionsByClaimWithNoProceedInterceptor)));
            container.Install(new MetricServiceInstaller());
            container.Install(new GenericServiceInstaller<Marker_EdFi_Dashboards_Warehouse_Resources>());
            container.Install(new GenericServiceInstaller<Marker_EdFi_Dashboards_Resources>());
            container.Install(new RepositoryInstaller<Marker_EdFi_Dashboards_Data>());
            container.Install(new RepositoryInstaller<Marker_EdFi_Dashboards_Metric_Data_Entities>());
            container.Install(new PersistedRepositoryInstaller<Marker_EdFi_Dashboards_Application_Data>());
            container.Install(new QueryInstaller<Marker_EdFi_Dashboards_Data>());
	        container.Install(new RepositoryInstaller<Marker_EdFi_Dashboards_Warehouse_Data>());

            container.Register(
                Classes.FromAssembly(securityAssembly)
                .BasedOn<IAuthorizationDelegate>()
                .WithService.FirstInterface(),
                Component.For<AuthorizationDelegateMap>());

            // Register the wrapped service locator singleton instance
            container.Register(
                Component.For<IServiceLocator>()
                    .Instance(IoC.WrappedServiceLocator));
        }
开发者ID:sybrix,项目名称:EdFi-App,代码行数:34,代码来源:SerializableModelFixture.cs

示例3: PreStart

 public static void PreStart()
 {
     var container = new WindsorContainer();
     container.Install(new DataAccessInstaller());
     container.Install(new CoreInstaller());
     container.Install(new ControllerInstaller());
 }
开发者ID:LucBos,项目名称:XmasChapterCQRS,代码行数:7,代码来源:WindsorBootstrapper.cs

示例4: InitializeWindsor

 private void InitializeWindsor()
 {
     _windsorContainer = new WindsorContainer();
     _windsorContainer.Install(FromAssembly.Containing<DependencyInstaller>());
     _windsorContainer.Install(FromAssembly.This());
     GlobalConfiguration.Configuration.DependencyResolver = new WindsorDependencyResolver(_windsorContainer.Kernel);
 }
开发者ID:jfvaleroso,项目名称:WMS,代码行数:7,代码来源:Global.asax.cs

示例5: Resolve_WithInstaller_ShouldBeNotNull

        public void Resolve_WithInstaller_ShouldBeNotNull()
        {
            var container = new WindsorContainer();

            var directory = AppDomain.CurrentDomain.BaseDirectory;

            var finder = AssemblyFinder.Builder.UsePath(directory).Create;

            container.Kernel.Resolver.AddSubResolver(new ArrayResolver(container.Kernel));

            container.Install(new ServiceLocatorInstaller());

            var assemblies = finder.GetAssembliesTagged<AssemblyTagAttribute>();

            container.Install(new FactoryInstaller(assemblies));

            var instance = container.Resolve<IObjectFactory>();

            instance.ShouldNotBeNull();

            instance.ConfigurationProvider.Configuration.Items.ShouldNotBeEmpty();

            instance.ConfigurationProvider.Configuration.Items.Count.ShouldBe(1);

            instance.ConfigurationProvider.Sources.ShouldNotBeEmpty();

            instance.ConfigurationProvider.Sources.Length.ShouldBe(2);

            instance.ShouldBeAssignableTo<IObjectFactory>();

            instance.ShouldBeOfType<ObjectFactory>();
        }
开发者ID:raulnq,项目名称:Jal.Factory,代码行数:32,代码来源:FactoryInstallerTests.cs

示例6: CreateContainer

        static IWindsorContainer CreateContainer()
        {
            IWindsorContainer container = new WindsorContainer();
            container.Install(FromAssembly.InThisApplication());
            container.Install(new DefaultHandlerInstaller());

            return container;
        }
开发者ID:Nybus-project,项目名称:Nybus,代码行数:8,代码来源:Program.cs

示例7: Main

        internal static void Main()
        {
            IWindsorContainer container = new WindsorContainer();
            container.Install(FromAssembly.InDirectory(new AssemblyFilter("Commands")));
            container.Install(FromAssembly.This());

            var interpretor = container.Resolve<CommandInterpreter>();
            interpretor.Run();
        }
开发者ID:Alano13,项目名称:Scene,代码行数:9,代码来源:Program.cs

示例8: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     IWindsorContainer container = new WindsorContainer();
     container.Install(Configuration.FromAppConfig());
     container.Install(FromAssembly.Named("com.Sconit.BatchJob.WindowsService"));
     IJobRunMgr jobRunMgr = container.Resolve<IJobRunMgr>();
     jobRunMgr.RunBatchJobs(container);
     container.Dispose();
 }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:9,代码来源:Form1.cs

示例9: Start

        public void Start()
        {
            _windsorContainer = new WindsorContainer();

            _windsorContainer.Install(FromAssembly.Containing<PhoneBookDependencyInstaller>());
            _windsorContainer.Install(FromAssembly.This());

            _windsorContainer.Resolve<IPeriodicServiceTrigger>().Start();
        }
开发者ID:saulomb,项目名称:CondominioNh,代码行数:9,代码来源:CondominioRunner.cs

示例10: Startable_and_components_in_separate_Install_Startable_last_works

		public void Startable_and_components_in_separate_Install_Startable_last_works()
		{
			using (var container = new WindsorContainer())
			{
				container.AddFacility<StartableFacility>(f => f.DeferredStart());
				container.Install(new DependenciesInstaller());
				container.Install(new StartableInstaller());
			}
		}
开发者ID:n2cms,项目名称:Castle.Windsor,代码行数:9,代码来源:StartableAndDecoratorsTestCase.cs

示例11: CreateContainer

        private IWindsorContainer CreateContainer()
        {
            var container = new WindsorContainer();
            container.Install(new PersistenceInstaller());
            container.Install(new ServicesInstaller());
            container.Install(new ControllersInstaller());
            container.Install(new HubsInstaller());

            return container;
        }
开发者ID:mirajavora,项目名称:signalr-f1live,代码行数:10,代码来源:Global.asax.cs

示例12: Initialize

		public void Initialize(string filename)
		{
			using (var container = new WindsorContainer())
			{
				container.Install(FromAssembly.Containing<DapperInstaller>());
				container.Install(FromAssembly.Containing<ServicesInstaller>());
				var importService = container.Resolve<ITransactionImportService>();
				importService.Import(filename);
			}
		}
开发者ID:kenwarner,项目名称:scrilla.js,代码行数:10,代码来源:Program.cs

示例13: Application_Start

        protected void Application_Start()
        {
            var container = new WindsorContainer();
            container.Install(new WebInstaller());
            container.Install(new BusInstaller());

            ServiceLocator.SetLocatorProvider(() => new WindsorServiceLocator(container));

            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
开发者ID:JakeStevenson,项目名称:MicroServicesTalk,代码行数:11,代码来源:Global.asax.cs

示例14: InitializeWindsor

 private void InitializeWindsor()
 {
     _windsorContainer = new WindsorContainer();
     _windsorContainer.Install(FromAssembly.Containing<DependencyInstaller>());
     _windsorContainer.Install(FromAssembly.This());
     ControllerBuilder.Current.SetControllerFactory(new WindsorControllerFactory(_windsorContainer.Kernel));
     //register web api dependency resolver
     GlobalConfiguration.Configuration.DependencyResolver = new WindsorDependencyResolver(_windsorContainer.Kernel);
     //filter
     System.Web.HttpContext.Current.Application["Windsor"] = _windsorContainer;
 }
开发者ID:jfvaleroso,项目名称:WMS_Revised,代码行数:11,代码来源:Global.asax.cs

示例15: Bootstrap

       public static IWindsorContainer Bootstrap()
       {
           XmlConfigurator.Configure();

           var container = new WindsorContainer();
           container.Kernel.Resolver.AddSubResolver(new CollectionResolver(container.Kernel, true));
           container.Install(new ControllerRegistry());
           container.Install(new BuildScreenRegistry());
           var controllerFactory = new WindsorControllerFactory(container.Kernel);
           ControllerBuilder.Current.SetControllerFactory(controllerFactory);           
           return container;
       }
开发者ID:iozag,项目名称:Buildscreen,代码行数:12,代码来源:Bootstrapper.cs


注:本文中的WindsorContainer.Install方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。