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


C# MutableConfiguration.CreateChild方法代码示例

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


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

示例1: GlobalJobListeners_with_no_registration_throws

 public void GlobalJobListeners_with_no_registration_throws()
 {
     var c = new WindsorContainer();
     var config = new MutableConfiguration("facility");
     config.CreateChild("quartz").CreateChild("item", "qwe").Attribute("key", "qq");
     config.CreateChild("globalJobListeners").CreateChild("item", "${jobli}");
     c.Kernel.ConfigurationStore.AddFacilityConfiguration("quartz", config);
     c.AddFacility("quartz", new QuartzFacility());
     c.Resolve<IScheduler>();
 }
开发者ID:mickdelaney,项目名称:QuartzNetIntegration,代码行数:10,代码来源:FacilityTests.cs

示例2: GlobalJobListeners

 public void GlobalJobListeners()
 {
     var c = new WindsorContainer();
     var config = new MutableConfiguration("facility");
     config.CreateChild("quartz").CreateChild("item", "qwe").Attribute("key", "qq");
     config.CreateChild("globalJobListeners").CreateChild("item", "${jobli}");
     c.Kernel.ConfigurationStore.AddFacilityConfiguration("quartz", config);
     c.Register(Component.For<IJobListener>().ImplementedBy<SomeJobListener>().Named("jobli"));
     c.AddFacility("quartz", new QuartzFacility());
     var scheduler = (QuartzNetScheduler)c.Resolve<IScheduler>();
     foreach (IJobListener l in scheduler.GlobalJobListeners)
         Console.WriteLine(l.Name);
     Assert.AreEqual(2, scheduler.GlobalJobListeners.Count);
 }
开发者ID:ramonsmits,项目名称:QuartzNetIntegration,代码行数:14,代码来源:FacilityTests.cs

示例3: GlobalTriggerListeners

        public void GlobalTriggerListeners()
        {
            var c = new WindsorContainer();
            var config = new MutableConfiguration("facility");
            config.CreateChild("quartz").CreateChild("item", "qwe").Attribute("key", "qq");
            config.CreateChild("globalTriggerListeners").CreateChild("item", "${jobli}");
            c.Kernel.ConfigurationStore.AddFacilityConfiguration("quartz", config);

            c.AddComponent("jobli", typeof (ITriggerListener), typeof (SomeTriggerListener));
            c.AddFacility("quartz", new QuartzFacility());

            var scheduler = c.Resolve<IScheduler>() as QuartzNetScheduler;
            foreach (ITriggerListener l in scheduler.GlobalTriggerListeners)
                Console.WriteLine(l.Name);
            Assert.AreEqual(1, scheduler.GlobalTriggerListeners.Count);
        }
开发者ID:mickdelaney,项目名称:QuartzNetIntegration,代码行数:16,代码来源:FacilityTests.cs

示例4: InvalidProtocol_throws

 public void InvalidProtocol_throws() {
     var configStore = new DefaultConfigurationStore();
     var configuration = new MutableConfiguration("facility");
     configuration.Attribute("type", typeof(SolrNetFacility).AssemblyQualifiedName);
     configuration.CreateChild("solrURL", "ftp://localhost");
     configStore.AddFacilityConfiguration(typeof(SolrNetFacility).FullName, configuration);
     new WindsorContainer(configStore);
 }
开发者ID:Jo1nes,项目名称:SolrNet,代码行数:8,代码来源:CastleFixture.cs

示例5: InvalidUrl_throws

 public void InvalidUrl_throws() {
     var configStore = new DefaultConfigurationStore();
     var configuration = new MutableConfiguration("facility");
     configuration.Attributes.Add("type", typeof(SolrNetFacility).FullName);
     configuration.CreateChild("solrURL", "123");
     configStore.AddFacilityConfiguration(typeof(SolrNetFacility).FullName, configuration);
     new WindsorContainer(configStore);
 }
开发者ID:Jo1nes,项目名称:SolrNet,代码行数:8,代码来源:CastleFixture.cs

示例6: ShouldBeAbleToSupplyValueForNullableParamViaCtor_FromConfig

		public void ShouldBeAbleToSupplyValueForNullableParamViaCtor_FromConfig()
		{
			var container = new WindsorContainer();
			var configuration = new MutableConfiguration("parameters");
			configuration.CreateChild("foo", "5");
			container.Register(Component.For<ClassTakingNullableViaCtor>().Configuration(configuration));

			container.Resolve<ClassTakingNullableViaCtor>();
		}
开发者ID:pmcg,项目名称:Castle.Windsor,代码行数:9,代码来源:IoC_142.cs

示例7: CreateModuleConfigurationNode

 private IConfiguration CreateModuleConfigurationNode()
 {
     var config = new MutableConfiguration("array");
     foreach (Type type in messageModules)
     {
         config.CreateChild("item", "${" + type.FullName + "}");
     }
     return config;
 }
开发者ID:BiYiTuan,项目名称:rhino-esb,代码行数:9,代码来源:RhinoServiceBusFacility.cs

示例8: Basic

 public void Basic()
 {
     var c = new WindsorContainer();
     var config = new MutableConfiguration("facility");
     config.CreateChild("quartz").CreateChild("item", "qwe").Attribute("key", "qq");
     c.Kernel.ConfigurationStore.AddFacilityConfiguration("quartz", config);
     c.AddFacility("quartz", new QuartzFacility());
     c.Resolve<IJobScheduler>();
     c.Resolve<IScheduler>();
 }
开发者ID:mickdelaney,项目名称:QuartzNetIntegration,代码行数:10,代码来源:FacilityTests.cs

示例9: ParseEndpoints_reflects_entries

		public void ParseEndpoints_reflects_entries()
		{
			var config = new MutableConfiguration("entries");
			config.CreateChild("item").Attribute("assembly", "asm1").Attribute("endpoint", "end");

			var reg = new RemoteEndpointRegistry();
			reg.ParseEndpoints(config);

			Assert.AreEqual(1, reg.EntriesCount);
		}
开发者ID:Nanako-Kbs,项目名称:castlezmq,代码行数:10,代码来源:RemoteEndpointRegistryTestCase.cs

示例10: ShouldBeAbleToSupplyValueForNullableParam_FromConfig

		public void ShouldBeAbleToSupplyValueForNullableParam_FromConfig()
		{
			var container = new WindsorContainer();
			var configuration = new MutableConfiguration("parameters");
			configuration.CreateChild("SomeVal", "5");
			container.Register(Component.For<ClassTakingNullable>().Configuration(configuration));

			var s = container.Resolve<ClassTakingNullable>();
			Assert.IsNotNull(s.SomeVal);
		}
开发者ID:vbedegi,项目名称:Castle.InversionOfControl,代码行数:10,代码来源:IoC_142.cs

示例11: JobListeners

        public void JobListeners()
        {
            var c = new WindsorContainer();
            var config = new MutableConfiguration("facility");
            config.CreateChild("quartz").CreateChild("item", "qwe").Attribute("key", "qq");
            var listenerConfig = config.CreateChild("jobListeners");
            listenerConfig
                .CreateChild("job")
                .Attribute("name", "someJob")
                .CreateChild("listener", "${jobli}");
            c.Kernel.ConfigurationStore.AddFacilityConfiguration("quartz", config);

            c.AddComponent("jobli", typeof (IJobListener), typeof (SomeJobListener));
            c.AddFacility("quartz", new QuartzFacility());

            var scheduler = c.Resolve<IScheduler>() as QuartzNetScheduler;
            foreach (var l in scheduler.JobListenerNames)
                Console.WriteLine(l);
            var jobli = scheduler.GetJobListener(typeof(SomeJobListener).AssemblyQualifiedName);
            Assert.IsNotNull(jobli);
        }
开发者ID:mickdelaney,项目名称:QuartzNetIntegration,代码行数:21,代码来源:FacilityTests.cs

示例12: FacilityRegistersReleasingJobListener

 public void FacilityRegistersReleasingJobListener()
 {
     using (var c = new WindsorContainer())
     {
         var config = new MutableConfiguration("facility");
         config.CreateChild("quartz");
         c.AddFacility<QuartzFacility>(f => f.Configure(config));
         var scheduler = c.Resolve<IScheduler>();
         //Assert.IsNotNull(scheduler.GlobalJobListeners);
         //Assert.AreEqual(2, scheduler.GlobalJobListeners.Count);
         Assert.IsAssignableFrom(typeof(ReleasingJobListener), scheduler.ListenerManager.GetJobListeners()[0]);
     }
 }
开发者ID:andreabalducci,项目名称:QuartzNetIntegration,代码行数:13,代码来源:FacilityTests.cs

示例13: Ping_Query

        public void Ping_Query()
        {
            var configStore = new DefaultConfigurationStore();
            var configuration = new MutableConfiguration("facility");
            configuration.Attribute("type", typeof(SolrNetFacility).AssemblyQualifiedName);
            configuration.CreateChild("solrURL", "http://localhost:8983/solr");
            configStore.AddFacilityConfiguration(typeof(SolrNetFacility).FullName, configuration);
            var container = new WindsorContainer(configStore);

            var solr = container.Resolve<ISolrOperations<CastleFixture.Document>>();
            solr.Ping();
            Console.WriteLine(solr.Query(SolrQuery.All).Count);
        }
开发者ID:FilipVV,项目名称:SolrNet,代码行数:13,代码来源:CastleIntegrationFixture.cs

示例14: tt

        public void tt()
        {
            var container = new WindsorContainer();
            var facilityConfig = new MutableConfiguration("facility");
            var assemblies = facilityConfig.CreateChild("assemblies");
            assemblies.CreateChild("item", GetType().Assembly.FullName);
            var nhConfig = facilityConfig.CreateChild("config");
            AddConfig(nhConfig, Environment.ConnectionDriver, typeof(SQLite20Driver).FullName);
            AddConfig(nhConfig, Environment.Dialect, typeof(SQLiteDialect).FullName);
            AddConfig(nhConfig, Environment.ConnectionProvider, typeof(DriverConnectionProvider).FullName);
            AddConfig(nhConfig, Environment.ProxyFactoryFactoryClass, typeof(ProxyFactoryFactory).AssemblyQualifiedName);
            AddConfig(nhConfig, Environment.ConnectionString, "Data Source=test.db;Version=3;New=True;");
            container.Kernel.ConfigurationStore.AddFacilityConfiguration("ar", facilityConfig);
            var arFacility = new ActiveRecordFacility();
            container.AddFacility("ar", arFacility);
            container.AddFacility<TransactionFacility>();

            ActiveRecordStarter.CreateSchema();

            container.AddComponent<TransactionalService>();
            container.Resolve<TransactionalService>().DoSomething();

            Assert.IsFalse(ActiveRecordMediator<Person>.Exists());
        }
开发者ID:ruanzx,项目名称:mausch,代码行数:24,代码来源:ARATMTests.cs

示例15: Basic

        public void Basic()
        {
            using (var c = new WindsorContainer())
            {
                var config = new MutableConfiguration("facility");
                config.CreateChild("quartz").CreateChild("item", "qwe").Attribute("key", "qq");
                c.AddFacility<QuartzFacility>(f => f.Configure(config));
                var js = c.Resolve<IJobScheduler>();
                var sched = c.Resolve<IScheduler>();
                var factory = c.Resolve<IJobFactory>();

                Assert.IsTrue(js is QuartzNetSimpleScheduler);
                Assert.IsTrue(sched is QuartzNetScheduler);
                Assert.IsTrue(factory is WindsorJobFactory);
            }
        }
开发者ID:andreabalducci,项目名称:QuartzNetIntegration,代码行数:16,代码来源:FacilityTests.cs


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