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


C# IKernel.AddFacility方法代码示例

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


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

示例1: Register

		/// <summary>
		/// Registers the facility to the container
		/// </summary>
		/// <param name="kernel"></param>
		public void Register(IKernel kernel)
		{
			var facilityConfiguration = configuration.Build();
			string facilityId = facilityConfiguration.Attributes["id"];
			kernel.ConfigurationStore.AddFacilityConfiguration(facilityId, facilityConfiguration);
			kernel.AddFacility<NHibernateFacility>(facilityId);
		}
开发者ID:cprieto,项目名称:Castle.Facilities.NHibernateIntegration,代码行数:11,代码来源:NHFacilityRegistration.cs

示例2: Execute

        /// <summary>
        /// Executes task.
        /// </summary>
        /// <param name="application">The application.</param>
        /// <param name="kernel">IoC container.</param>
        public void Execute(IApplication application, IKernel kernel)
        {
            var facilityConfig = GetFacilityConfig(application);

            kernel.ConfigurationStore.AddFacilityConfiguration("nhibernate.facility", facilityConfig);
            kernel.AddFacility("nhibernate.facility", new NHibernateFacility(new NHibernateConfigurator(application, kernel)));
        }
开发者ID:coreframework,项目名称:Core-Framework,代码行数:12,代码来源:ConfigureNHibernateFacility.cs

示例3: Setup

		public void Setup()
		{
			kernel = new DefaultKernel();
			kernel.AddFacility<MethodValidatorFacility>();
			kernel.Register(Component.For<IOrderService>().ImplementedBy<OrderService>());
			//Add the WindsorContainer so we have an IProxyFactory instance
			WindsorContainer container = new WindsorContainer(kernel, new DefaultComponentInstaller());
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:8,代码来源:MethodValdidationFacilityTests.cs

示例4: CastleAspectContainer

 /// <summary>
 /// Initializes a new instance of the <see cref="CastleAspectContainer"/> class.
 /// </summary>
 /// <param name="container">The container.</param>
 public CastleAspectContainer(IKernel container)
 {
     Proxy = new MasterProxy {Container = new WindsorServiceLocatorAdapter(container)};
     _kernel = container;
     _kernel.Register(Component.For(GetType()).Named("CastleAspectContainer").Instance(this));
     _kernel.Register(Component.For(Proxy.GetType())/*.Named("MasterProxy")*/.Instance(Proxy));
     _kernel.AddFacility<CastleAspectFacility>();
     _kernel.Register(Component.For<PseudoInterceptor>());
 }
开发者ID:nickspoons,项目名称:Snap,代码行数:13,代码来源:CastleAspectContainer.cs

示例5: CastleAspectContainer

 /// <summary>
 /// Initializes a new instance of the <see cref="CastleAspectContainer"/> class.
 /// </summary>
 /// <param name="container">The container.</param>
 public CastleAspectContainer(IKernel container)
 {
     Proxy = new MasterProxy();
     _kernel = container;
     _kernel.Register(Component.For(this.GetType()).Named("CastleAspectContainer").Instance(this));
     _kernel.Register(Component.For(Proxy.GetType()).Named("MasterProxy").Instance(Proxy));
     _kernel.AddFacility<CastleAspectFacility>();
     _kernel.Register(Component.For<PseudoInterceptor>());
 }
开发者ID:grava,项目名称:Snap,代码行数:13,代码来源:CastleAspectContainer.cs

示例6: Register

        public virtual void Register(IKernel kernel)
        {
            kernel.AddFacility<TypedFactoryFacility>();

            kernel.Register(Component.For<IViewModelFactory>().AsFactory());

            kernel.Register(Component.For<IDialogFactory>().AsFactory());

            kernel.Register(AllTypes.FromAssemblyContaining<ViewModelRegistration>()
                                    .Where(t => t.Namespace == "Rhino.Licensing.AdminTool.Factories")
                                    .WithService.FirstInterfaceOnClass());
        }
开发者ID:BlueBlock,项目名称:rhino-licensing,代码行数:12,代码来源:FactoryRegistration.cs

示例7: Init

		public void Init()
		{
			_kernel = new DefaultKernel();

			IConfiguration confignode = new MutableConfiguration("facility");
			IConfiguration facilityConf = confignode.Children.Add(new MutableConfiguration(FacilityKey));
			_kernel.ConfigurationStore.AddFacilityConfiguration(FacilityKey, confignode);

			_facility = new HiperFacility();

			Assert.IsFalse(_facility.Initialized);
			_kernel.AddFacility(FacilityKey, _facility);
		}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:13,代码来源:FacilityTestCase.cs

示例8: SetUp

		public void SetUp()
		{
			kernel = new DefaultKernel();

			kernel.AddFacility<StartableFacility>();

			kernel.Register(
				Component.For<StartableDisposableAndInitializableComponent>()
					.LifeStyle.Transient
				);

			component = kernel.Resolve<StartableDisposableAndInitializableComponent>();
			component.DoSomething();
			kernel.ReleaseComponent(component);

			calledMethods = component.calledMethods;
		}
开发者ID:AGiorgetti,项目名称:Castle.InversionOfControl,代码行数:17,代码来源:IoC_113.cs

示例9: Init

		public void Init()
		{
			facility = new FactorySupportFacility();
			kernel = new DefaultKernel();
			kernel.AddFacility("factory.support", facility);
		}
开发者ID:gschuager,项目名称:Castle.Windsor,代码行数:6,代码来源:FactorySupportProgrammaticTestCase.cs

示例10: SetUp

		public void SetUp()
		{
			kernel = new DefaultKernel();
			kernel.AddFacility<FactorySupportFacility>();
		}
开发者ID:ralescano,项目名称:castle,代码行数:5,代码来源:FactorySupportFluentTestCase.cs


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