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


C# Registry.IncludeRegistry方法代码示例

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


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

示例1: GetContainer

		public static IContainer GetContainer()
		{
			var register = new Registry();
			register.IncludeRegistry<MirutradingRegistry>();
			IContainer container = new Container(register);
			return container;
		}
开发者ID:superkklot,项目名称:Mirutrading,代码行数:7,代码来源:ContainerFactory.cs

示例2: Process

        public void Process(Type type, Registry registry)
        {
            if (!Registry.IsPublicRegistry(type)) return;

            // TODO -- good exception message
            var r = (Registry)Activator.CreateInstance(type);
            registry.IncludeRegistry(r);
        }
开发者ID:satish860,项目名称:StructureMap3,代码行数:8,代码来源:FindRegistriesScanner.cs

示例3: Initialize

        public static IContainer Initialize() {
            //var container = new Container(_ =>
            //{
            //    _.Scan(x =>
            //    {
            //        x.TheCallingAssembly();
            //        x.WithDefaultConventions();
            //    });
            //});

            var registry = new Registry();
            registry.IncludeRegistry<PurpleRegistry>();
            // build a container
            var container = new Container(registry);

            return container;
        }
开发者ID:RichardWysocki,项目名称:PairProgram,代码行数:17,代码来源:IoC.cs

示例4: include_a_registry

 public void include_a_registry()
 {
     var registry = new Registry();
     registry.IncludeRegistry<YellowBlueRegistry>();
     registry.IncludeRegistry<RedGreenRegistry>();
     registry.IncludeRegistry<PurpleRegistry>();
     // build a container
     var container = new Container(registry);
     // verify the default implementation and total registered implementations
     container.GetInstance<IWidget>().ShouldBeOfType<AWidget>();
     container.GetAllInstances<IWidget>().Count().ShouldEqual(5);
 }
开发者ID:flq,项目名称:structuremap,代码行数:12,代码来源:RegistryTester.cs

示例5: include_an_existing_registry_should_not_reevaluate_the_registry

        public void include_an_existing_registry_should_not_reevaluate_the_registry()
        {
            var registry1 = new Registry();
            registry1.IncludeRegistry<MutatingRegistry>();

            var registry2 = new Registry();
            registry2.IncludeRegistry<MutatingRegistry>();

            var container = new Container(config => {
                config.AddRegistry(registry1);
                config.AddRegistry(registry2);
            });

            container.GetInstance<IWidget>().ShouldBeOfType<AWidget>();
        }
开发者ID:flq,项目名称:structuremap,代码行数:15,代码来源:RegistryTester.cs

示例6: include_an_existing_registry_should_not_reevaluate_the_registry

        public void include_an_existing_registry_should_not_reevaluate_the_registry()
        {
            var registry1 = new Registry();
            registry1.IncludeRegistry<MutatingRegistry>();

            var registry2 = new Registry();
            registry2.IncludeRegistry<MutatingRegistry>();

            var container = new Container(config =>
            {
                config.AddRegistry(registry1);
                config.AddRegistry(registry2);
            });

            container.Model.Registries.Count(x => x.GetType() == typeof(MutatingRegistry)).ShouldBe(1);
        }
开发者ID:slahn,项目名称:structuremap,代码行数:16,代码来源:RegistryTester.cs

示例7: include_a_registry

        public void include_a_registry()
        {
            var registry = new Registry();
            registry.IncludeRegistry<YellowBlueRegistry>();
            registry.IncludeRegistry<RedGreenRegistry>();
            registry.IncludeRegistry<PurpleRegistry>();

            var container = new Container(registry);

            container.GetInstance<IWidget>().ShouldBeOfType<AWidget>();

            container.GetAllInstances<IWidget>().Count.ShouldEqual(5);
        }
开发者ID:satish860,项目名称:StructureMap3,代码行数:13,代码来源:RegistryTester.cs

示例8: include_an_existing_registry_should_not_reevaluate_the_registry

        public void include_an_existing_registry_should_not_reevaluate_the_registry()
        {
            var registry1 = new Registry();
            registry1.IncludeRegistry<MutatingRegistry>();

            var registry2 = new Registry();
            registry2.IncludeRegistry<MutatingRegistry>();

            var container = new Container(config =>
            {
                config.AddRegistry(registry1);
                config.AddRegistry(registry2);
            });

            // If MutatingRegistry is applied more than once, it will
            // change the default IWidget to MutatedWidget and cause
            // the following specification to fail
            container.GetInstance<IWidget>().ShouldBeOfType<AWidget>();
        }
开发者ID:satish860,项目名称:StructureMap3,代码行数:19,代码来源:RegistryTester.cs


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