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


C# IWindsorContainer.Install方法代码示例

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


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

示例1: Register

 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));
 }
开发者ID:jeremielumandong,项目名称:RailWaySample,代码行数:7,代码来源:WindsorConfig.cs

示例2: Register

        public void Register(IWindsorContainer container)
        {
            container.Register(
                Component.For<IUserFactory>().ImplementedBy<UserFactory>(),
                Component.For<IRavenUniqueInserter>().ImplementedBy<RavenUniqueInserter>(),
                Component.For<IRecentReadsQuery>().ImplementedBy<RecentReadsQuery>(),
                Component.For<IUserRepository>().ImplementedBy<UserRepository>(),
                Component.For<IBookRepository>().ImplementedBy<BookRepository>(),
                Component.For<IBookImporter>().ImplementedBy<BookImporter>(),
                Component.For<IAuthCookieEncoder>().ImplementedBy<AuthCookieEncoder>()
                    .Named("AuthCookieEncoder").DependsOn(new {secretKey = AuthCookieSecretKey.Value}),
                Component.For<IAuthCookieEncoder>().ImplementedBy<AuthCookieCache>()
                    .ServiceOverrides(new {encoder = "AuthCookieEncoder"}),
                Component.For<ICurrentUserInfoFactory>().ImplementedBy<CurrentUserInfoFactory>(),
                Component.For<ICurrentUserInfoProvider>().ImplementedBy<CurrentUserInfoProvider>(),
                Component.For<IAuthCookieFactory>().ImplementedBy<AuthCookieFactory>(),
                Component.For<IGoogleBooksClient>().ImplementedBy<GoogleBooksClient>()
                    .DependsOn(new
                                   {
                                       apiKey = "AIzaSyDQsH0G4o3l9FjHUocTO_edha6Pv8N3NXo"
                                   }),
                Component.For<IDocumentStore>().UsingFactoryMethod(GetDocumentStore));

            container.Install(new WebInstaller());
            container.Install(new ApiInstaller());
        }
开发者ID:rdingwall,项目名称:100books,代码行数:26,代码来源:WindsorRegistration.cs

示例3: BootstrapContainer

 private static void BootstrapContainer()
 {
     container = new WindsorContainer();
     container.Install(Configuration.FromAppConfig());
     container.Install(FromAssembly.This());
     var controllerFactory = new WindsorControllerFactory(container);
     ControllerBuilder.Current.SetControllerFactory(controllerFactory);           
 }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:8,代码来源:Global.asax.cs

示例4: InitializeWindsor

        private void InitializeWindsor()
        {
            _windsorContainer = new WindsorContainer();
            _windsorContainer.Install(FromAssembly.Containing<BloghostDependencyInstaller>());
            _windsorContainer.Install(FromAssembly.This());

            ControllerBuilder.Current.SetControllerFactory(new WindsorControllerFactory(_windsorContainer.Kernel));
        }
开发者ID:nancy-bree,项目名称:Bloghost,代码行数:8,代码来源:Global.asax.cs

示例5: BatchJobService

 public BatchJobService()
 {
     InitializeComponent();
     container = new WindsorContainer();
     container.Install(Configuration.FromAppConfig());
     container.Install(FromAssembly.This());
     log = log4net.LogManager.GetLogger("Log.BatchJob");
     this.ServiceName = "BatchJobService";
 }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:9,代码来源:BatchJobService.cs

示例6: CastleConfig

        public static void CastleConfig(IWindsorContainer container)
        {
            var config = new Config();
            config.UseWindsorContructor = true;

            container.Install(new SitecoreInstaller(config));
            container.Install(new ServiceInstaller());

        }
开发者ID:bplasmeijer,项目名称:Glass.Mapper,代码行数:9,代码来源:GlassMapperScCustom.cs

示例7: PrintClient

 public PrintClient()
 {
     container = new WindsorContainer();
     container.Install(Castle.Windsor.Installer.Configuration.FromAppConfig());
     container.Install(Castle.Windsor.Installer.FromAssembly.This());
     IsServerOK = this.OpenHeartBeatToServer();
     InitializeComponent();
     LoadSubList();
     Inti();
 }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:10,代码来源:PrintClient.cs

示例8: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            container = new WindsorContainer();
            container.Install(FromAssembly.Containing(typeof(IFileNameChangerService)));
            container.Install(FromAssembly.This());

            var start = container.Resolve<MainWindow>();
            start.ShowDialog();
        }
开发者ID:kamilzegadlo,项目名称:Async-WPF-FileNameChanger,代码行数:10,代码来源:App.xaml.cs

示例9: SetupContainer

        private void SetupContainer()
        {
            _container = new WindsorContainer(new XmlInterpreter("Windsor.config"));

            _container.Register(Component.For<IWindsorContainer>().Instance(_container));

            _container.Install(new BusInstaller(Keys.CommandServiceEndpoint));
            _container.Install(new CommandHandlerInstaller());

            _bus = _container.Resolve<IBus>();
        }
开发者ID:liliakraft,项目名称:KodingKata,代码行数:11,代码来源:Program.cs

示例10: BootstrapContainer

 private static void BootstrapContainer()
 {
     container = new WindsorContainer();
     container.AddFacility("transactionmanagement", new TransactionFacility());
     container.Install(Configuration.FromAppConfig());
     container.Install(FromAssembly.Named("com.Sconit.Persistence"));
     container.Install(FromAssembly.Named("com.Sconit.Service"));
     container.Install(FromAssembly.This());
     var controllerFactory = new WindsorControllerFactory(container);
     ControllerBuilder.Current.SetControllerFactory(controllerFactory);           
 }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:11,代码来源:Global.asax.cs

示例11: Run

        public void Run()
        {
            Container = new WindsorContainer();
            Container.AddFacility<TypedFactoryFacility>();
            Container.Install(Configuration.FromXmlFile("Config/Windsor.config"));
            Container.Install(FromAssembly.This());

            Container.Register(Component.For<IServiceLocator>().Instance(new WindsorServiceLocator(Container)));

            ServiceLocator.SetLocatorProvider(Container.Resolve<IServiceLocator>);
        }
开发者ID:Jinlai,项目名称:SSIGlass,代码行数:11,代码来源:ApplicationBootstrapper.cs

示例12: Application_Startup

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            _container = new WindsorContainer();

            _container.AddFacility<TypedFactoryFacility>();
            _container.Install(FromAssembly.InThisApplication());
            _container.Install(FromAssembly.Named("Filtration.Parser"));

            var mainWindow = _container.Resolve<IMainWindow>();
            mainWindow.Show();
        }
开发者ID:mihailim,项目名称:Filtration,代码行数:11,代码来源:App.xaml.cs

示例13: Boostrapper

        public Boostrapper()
        {
            _container = new WindsorContainer();
            _container.AddFacility<LoggingFacility>(facility => facility.UseLog4Net());

            _container.Install(new EventstoreInstaller());
            _container.Install(new BusInstaller());

            Logger = _container.Resolve<ILogger>();

            Logger.DebugFormat("Started");
        }
开发者ID:barissonmez,项目名称:nes-training,代码行数:12,代码来源:Boostrapper.cs

示例14: ApplicationContainer

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

            container.AddFacility<TypedFactoryFacility>();
            container.AddFacility<LoggingFacility>(f => f.LogUsing(LoggerImplementation.Log4net).WithConfig("log4net.xml"));
            container.Kernel.Resolver.AddSubResolver(new CollectionResolver(container.Kernel));
            container.Register(Component.For<LogInterceptor>());

            container.Install(new RepositoryInstaller());
            container.Install(new PresentationInstaller());
            container.Install(new ApplicationInstaller());
        }
开发者ID:kobbikobb,项目名称:TimeManager,代码行数:13,代码来源:ApplicationContainer.cs

示例15: ConfigureApplicationContainer

        protected override void ConfigureApplicationContainer(IWindsorContainer existingContainer)
        {
            base.ConfigureApplicationContainer(existingContainer);

            // Add the Array Resolver, so we can take dependencies on T[]
            // while only registering T.
            existingContainer.Kernel.Resolver.AddSubResolver(new ArrayResolver(existingContainer.Kernel));
            // todo use in Selkie project

            existingContainer.Install(FromAssembly.Containing(typeof ( Installer )));
            existingContainer.Install(FromAssembly.Containing(typeof ( MicroServices.Days.Nancy.Installer )));
            existingContainer.Install(FromAssembly.Containing(typeof ( MicroServices.Doctors.Nancy.Installer )));
            existingContainer.Install(FromAssembly.Containing(typeof ( MicroServices.DoctorsSlots.Nancy.Installer )));
            existingContainer.Install(FromAssembly.Containing(typeof ( MicroServices.Slots.Nancy.Installer )));
        }
开发者ID:tschroedter,项目名称:DoctorsAppointment,代码行数:15,代码来源:Bootstrapper.cs


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