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


C# IWindsorContainer.AddComponent方法代码示例

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


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

示例1: Register

        public void Register(IWindsorContainer container)
        {
            container.AddComponent(
                    "entityDuplicateChecker",
                    typeof(IEntityDuplicateChecker),
                    typeof(EntityDuplicateChecker));

            container.AddComponent(
                    "repositoryType",
                    typeof(IRepository<>),
                    typeof(Repository<>));

            container.AddComponent(
                    "nhibernateRepositoryType",
                    typeof(INHibernateRepository<>),
                    typeof(NHibernateRepository<>));

            container.AddComponent(
                    "repositoryWithTypedId",
                    typeof(IRepositoryWithTypedId<,>),
                    typeof(RepositoryWithTypedId<,>));

            container.AddComponent(
                    "nhibernateRepositoryWithTypedId",
                    typeof(INHibernateRepositoryWithTypedId<,>),
                    typeof(NHibernateRepositoryWithTypedId<,>));
        }
开发者ID:riccardod,项目名称:Who-Can-Help-Me,代码行数:27,代码来源:GenericRepositoryRegistrar.cs

示例2: AddRepositoriesTo

 private static void AddRepositoriesTo(IWindsorContainer container)
 {
     container.AddComponent("repository", typeof(IRepository), typeof(Repository));
     container.AddComponent("genericRepository", typeof(IRepository<>), typeof(Repository<>));
     container.AddComponent("typedRepository", typeof(IRepositoryWithTypedId<,>),
                            typeof(RepositoryWithTypedId<,>));
 }
开发者ID:ucdavis,项目名称:HelpRequest,代码行数:7,代码来源:ComponentRegistrar.asax.cs

示例3: AddComponentsTo

        public static void AddComponentsTo(IWindsorContainer container)
        {
            AddGenericRepositoriesTo(container);

            container.AddComponent("validator",
                                   typeof(IValidator), typeof(Validator));
            container.AddComponent("dbContext", typeof(IDbContext), typeof(DbContext));
        }
开发者ID:srkirkland,项目名称:UCDArchVsTemplate,代码行数:8,代码来源:ComponentRegistrar.cs

示例4: AddComponentsTo

        public static void AddComponentsTo(IWindsorContainer container)
        {
            ParameterCheck.ParameterRequired(container, "container");

            if (!container.Kernel.HasComponent("ExceptionLogger")) {
                container.AddComponent("ExceptionLogger", typeof(IExceptionLogger), typeof(ExceptionLogger));
                container.AddComponent("MethodLogger", typeof(IMethodLogger), typeof(MethodLogger));
            }
        }
开发者ID:robiee4u,项目名称:Sharp-Architecture-Contrib,代码行数:9,代码来源:ComponentRegistrar.cs

示例5: SetUp

		public void SetUp()
		{
			_container = new WindsorContainer(ConfigHelper.ResolvePath("../Castle.Facilities.Cache.Tests.config"));
			_container.AddComponent("ServiceA",typeof(IServiceA), typeof(ServiceA));
			_container.AddComponent("ServiceC",typeof(IServiceC), typeof(ServiceC));
			_container.AddComponent("ServiceD",typeof(IServiceD), typeof(ServiceD));

			ResetConsoleOut();
		}
开发者ID:ralescano,项目名称:castle,代码行数:9,代码来源:CacheTest.cs

示例6: AddGenericRepositoriesTo

 private static void AddGenericRepositoriesTo(IWindsorContainer container) {
     container.AddComponent("repositoryType",
         typeof(IRepository<>), typeof(Repository<>));
     container.AddComponent("nhibernateRepositoryType",
         typeof(INHibernateRepository<>), typeof(NHibernateRepository<>));
     container.AddComponent("repositoryWithTypedId",
         typeof(IRepositoryWithTypedId<,>), typeof(RepositoryWithTypedId<,>));
     container.AddComponent("nhibernateRepositoryWithTypedId",
         typeof(INHibernateRepositoryWithTypedId<,>), typeof(NHibernateRepositoryWithTypedId<,>));
 }
开发者ID:EdisonCP,项目名称:sharp-architecture,代码行数:10,代码来源:ComponentRegistrar.cs

示例7: SetupWindsor

 private void SetupWindsor()
 {
     container = new WindsorContainer(new XmlInterpreter());
     var configBuilder = new NHConfigBuilder(Server.MapPath("/"));
     container.AddFacility("nhibernate", new NHibernateFacility(configBuilder));
     container.AddFacility<TransactionFacility>();
     container.AddComponent<TransactionalService>();
     container.AddComponent<HomeController>("home");
     new SchemaExport(configBuilder.GetConfiguration(null)).Execute(false, true, false);
     ControllerBuilder.Current.SetControllerFactory(new WindsorControllerFactory(container));
 }
开发者ID:ruanzx,项目名称:mausch,代码行数:11,代码来源:Global.asax.cs

示例8: AddComponentsTo

        public static void AddComponentsTo(IWindsorContainer container)
        {
            //Add your components here
            container.AddComponent("validator", typeof(IValidator), typeof(Validator));
            container.AddComponent("dbContext", typeof(IDbContext), typeof(DbContext));
            container.AddComponent("emailProvider", typeof(IEmailProvider), typeof(EmailProvider));
            container.AddComponent("ticketControllerService", typeof (ITicketControllerService),
                                   typeof (TicketControllerService));

            AddRepositoriesTo(container);
        }
开发者ID:ucdavis,项目名称:HelpRequest,代码行数:11,代码来源:ComponentRegistrar.asax.cs

示例9: Init

		public void Init()
		{
			container = new WindsorContainer(ConfigHelper.ResolveConfigPath("Facilities/TypedFactory/typedFactory_castle_config.xml"));
			
			container.AddFacility( "typedfactory", new TypedFactoryFacility() );

			container.AddComponent( "miranda", typeof(IProtocolHandler), typeof(MirandaProtocolHandler) );
			container.AddComponent( "messenger", typeof(IProtocolHandler), typeof(MessengerProtocolHandler) );
			container.AddComponent( "comp1", typeof(IDummyComponent), typeof(Component1) );
			container.AddComponent( "comp2", typeof(IDummyComponent), typeof(Component2) );
		}
开发者ID:AGiorgetti,项目名称:Castle.InversionOfControl,代码行数:11,代码来源:ExternalConfigurationTestCase.cs

示例10: Init

		public void Init()
		{
			_container = new WindsorContainer( @"..\typedFactory_castle_config.xml" );
			
			_container.AddFacility( "typedfactory", new TypedFactoryFacility() );

			_container.AddComponent( "miranda", typeof(IProtocolHandler), typeof(MirandaProtocolHandler) );
			_container.AddComponent( "messenger", typeof(IProtocolHandler), typeof(MessengerProtocolHandler) );
			_container.AddComponent( "comp1", typeof(IDummyComponent), typeof(Component1) );
			_container.AddComponent( "comp2", typeof(IDummyComponent), typeof(Component2) );
		}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:11,代码来源:ExternalConfigurationTestCase.cs

示例11: Register

        public void Register(IWindsorContainer container)
        {
            container.Register(
                   AllTypes.Pick()
                           .FromAssembly(Assembly.GetAssembly(typeof(ControllersRegistrarMarker)))
                           .If(f => f.Namespace.Contains(".Mappers"))
                           .WithService.FirstInterface());

            container.AddComponent("mapper1", typeof(IMapper<,>), typeof(Mapper<,>));
            container.AddComponent("mapper2", typeof(IMapper<,,>), typeof(Mapper<,,>));
        }
开发者ID:jonhilt,项目名称:Who-Can-Help-Me,代码行数:11,代码来源:MapperRegistrar.cs

示例12: AddComponentsTo

        public static void AddComponentsTo(IWindsorContainer container)
        {
            //Add your components here
            container.AddComponent("validator",
                                   typeof(IValidator), typeof(Validator));
            container.AddComponent("dbContext", typeof (IDbContext), typeof (DbContext));

            AddBLLsTo(container);

            AddRepositoriesTo(container);
        }
开发者ID:ucdavis,项目名称:EligibilityList,代码行数:11,代码来源:ComponentRegistrar.asax.cs

示例13: GetInstance

        public static IWindsorContainer GetInstance()
        {
            if (container == null)
            {
                container = new WindsorContainer(new XmlInterpreter("CastleIoc/BasicUsage.xml"));

                container.AddComponent("txtLog", typeof(ILog), typeof(TextFileLog));
                container.AddComponent("txtFormat", typeof(ILogFormatter), typeof(TextFormat));
            }

            return container;
        }
开发者ID:zjk537,项目名称:ModelCollect,代码行数:12,代码来源:CastleIocManager.cs

示例14: Init

		public void Init()
		{
			container = new WindsorContainer(new XmlInterpreter(new ConfigResource()));

			container.AddFacility("transactionfacility", new TransactionFacility() );
			container.AddFacility("arfacility", new ActiveRecordFacility() );

			container.AddComponent( "blog.service", typeof(BlogService) );
			container.AddComponent( "post.service", typeof(PostService) );
			container.AddComponent( "first.service", typeof(FirstService) );
			container.AddComponent( "wiring.service", typeof(WiringSession) );

			Recreate();
		}
开发者ID:ralescano,项目名称:castle,代码行数:14,代码来源:AbstractActiveRecordTest.cs

示例15: AddGenericRepositoriesTo

 private static void AddGenericRepositoriesTo(IWindsorContainer container)
 {
     container.AddComponent(
         "sessionFactoryKeyProvider", typeof(ISessionFactoryKeyProvider), typeof(DefaultSessionFactoryKeyProvider));
     container.AddComponent("repositoryType", typeof(IRepository<>), typeof(NHibernateRepository<>));
     container.AddComponent(
         "nhibernateRepositoryType", typeof(INHibernateRepository<>), typeof(NHibernateRepository<>));
     container.AddComponent(
         "repositoryWithTypedId", typeof(IRepositoryWithTypedId<,>), typeof(NHibernateRepositoryWithTypedId<,>));
     container.AddComponent(
         "nhibernateRepositoryWithTypedId",
         typeof(INHibernateRepositoryWithTypedId<,>),
         typeof(NHibernateRepositoryWithTypedId<,>));
 }
开发者ID:seif,项目名称:Northwind,代码行数:14,代码来源:ComponentRegistrar.cs


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