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


C# Registry类代码示例

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


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

示例1: Process

        public void Process(Type type, Registry registry)
        {
            var validatorTypes = type.FindInterfacesThatClose(typeof(IValidator<>));

            foreach(var validatorType in validatorTypes)
                registry.AddType(validatorType, type);
        }
开发者ID:trullock,项目名称:MuonKit,代码行数:7,代码来源:ValidatorRegistrationConvention.cs

示例2: Process

 public void Process(Type type, Registry registry)
 {
     if (type.CanBeCastTo<Controller>() && !type.IsAbstract)
     {
         registry.For(type).LifecycleIs(new UniquePerRequestLifecycle());
     }
 }
开发者ID:rexdefuror,项目名称:shopapp,代码行数:7,代码来源:Controllers.cs

示例3: Process

 private void Process(Type type, Registry registry)
 {
     if (type.CanBeCastTo(typeof(Controller)) && !type.IsAbstract)
     {
         registry.For(type).LifecycleIs(new UniquePerRequestLifecycle());
     }
 }
开发者ID:MattHoneycutt,项目名称:HeroicFramework,代码行数:7,代码来源:ControllerConvention.cs

示例4: SetupSingletons

 private void SetupSingletons(Registry registry)
 {
     foreach (Type type in _singletons)
     {
         registry.For(type).Singleton();
     }
 }
开发者ID:group6tech,项目名称:noobot,代码行数:7,代码来源:ContainerFactory.cs

示例5: ConfigureModuleSpecificDependencies

 private static void ConfigureModuleSpecificDependencies(Registry registry)
 {
     registry.For<IMasslogConfiguration>().Singleton().Use<LoggingConfiguration>();
     registry.For<ILoggingConfiguration>().Singleton().Use<LoggingConfiguration>();
     registry.For<IMonitorBehaviorFactory>().Singleton().Use<MonitorBehaviorFactory>();
     registry.For<IMonitor>().HttpContextScoped().Use<Monitor>();
 }
开发者ID:ByteCarrot,项目名称:Masslog,代码行数:7,代码来源:LoggingModuleIoC.cs

示例6: Process

 public void Process(Type type, Registry registry)
 {
     if(type.GetInterfaces().Contains(typeof(IQuery)) && !type.IsAbstract)
     {
         registry.For(typeof (IQuery)).Use(type);
     }
 }
开发者ID:AbdoNile,项目名称:Foundation,代码行数:7,代码来源:QueryRegisterationConventrion.cs

示例7: ScanTypes

        public void ScanTypes(TypeSet types, Registry registry)
        {
            types.FindTypes(TypeClassification.Closed | TypeClassification.Concretes)
                .Where(Registry.IsPublicRegistry)
                .Each(type => registry.Configure(x => x.ImportRegistry(type)));

        }
开发者ID:slahn,项目名称:structuremap,代码行数:7,代码来源:FindRegistriesScanner.cs

示例8: Process

        public void Process(Type type, Registry registry)
        {




        }
开发者ID:ItsJustSean,项目名称:TailBlazer,代码行数:7,代码来源:AppConventions.cs

示例9: Process

 public void Process(Type type, Registry registry)
 {
     if (!type.IsAbstract && typeof(ICommandEvent).IsAssignableFrom(type))
     {
         registry.AddType(typeof(ICommand), typeof(EventCommand<>).MakeGenericType(type), type.Name);
     }
 }
开发者ID:ArildF,项目名称:PTB,代码行数:7,代码来源:CommandEventRegistrationConvention.cs

示例10: PluginGraphBuilder

 public PluginGraphBuilder(ConfigurationParser[] parsers, Registry[] registries, GraphLog log)
 {
     _parsers = parsers;
     _registries = registries;
     _graph = new PluginGraph();
     _graph.Log = log;
 }
开发者ID:hp4711,项目名称:structuremap,代码行数:7,代码来源:PluginGraphBuilder.cs

示例11: Process

 public void Process(Type type, Registry registry)
 {
     if (type.CanBeCastTo(typeof(Controller)) && !type.IsAbstract)
     {
         registry.For(type).LifecycleIs(new UniquePerRequestLifecycle());// will create a new instance per request
     }
 }
开发者ID:hebert26,项目名称:MVC.Training,代码行数:7,代码来源:ControllerConvention.cs

示例12: Generate

        public INoobotContainer Generate()
        {
            var registry = new Registry();

            registry.Scan(x =>
            {
                x.TheCallingAssembly();
                x.WithDefaultConventions();
            });

            registry = _pipelineManager.Initialise(registry);
            registry = _pluginManager.Initialise(registry);

            registry
                .For<ISlackWrapper>()
                .Singleton();

            registry
                .For<IPipelineFactory>()
                .Singleton();

            Type[] pluginTypes = _pluginManager.ListPluginTypes();
            var container = new NoobotContainer(registry, pluginTypes);

            IPipelineFactory pipelineFactory = container.GetInstance<IPipelineFactory>();
            pipelineFactory.SetContainer(container);

            return container;
        }
开发者ID:irmbrady,项目名称:noobot,代码行数:29,代码来源:ContainerGenerator.cs

示例13: Application

        public Application()
        {
            _peers = new List<Case42Peer>();
            Registry = new Registry();

            Registry.Set(new LobbyComponent(this));
        }
开发者ID:brookerk,项目名称:case42rpg,代码行数:7,代码来源:Application.cs

示例14: Apply

        public void Apply(PluginGraph graph)
        {
            var registry = new Registry();

            _interfaces.Each(@interface =>
            {
                var expression = registry.For(@interface);
                ConfigureFamily(expression);

                var exactMatches = _concretions.Where(x => x.CanBeCastTo(@interface)).ToArray();
                if (exactMatches.Length == 1)
                {
                    expression.Use(exactMatches.Single());
                }
                else
                {
                    exactMatches.Each(type => expression.Add(type));
                }


                if ([email protected]())
                {
                    addConcretionsThatCouldBeClosed(@interface, expression);
                }
            });

            _concretions.Each(t => graph.ConnectedConcretions.Fill(t));
            registry.As<IPluginGraphConfiguration>().Configure(graph);
        }
开发者ID:goraw,项目名称:structuremap,代码行数:29,代码来源:GenericConnectionScanner.cs

示例15: RegisterCommand

        public void RegisterCommand(Registry registry)
        {
            var openCommandMethodResultType = typeof(CommandResult<>);
            var closedCommandMethodResultType = openCommandMethodResultType.MakeGenericType(CommandType);

            var openActionMethodInvokerType = typeof(IActionMethodResultInvoker<>);
            var closedActionMethodInvokerType =
                openActionMethodInvokerType.MakeGenericType(closedCommandMethodResultType);

            var closedDomainResultType = typeof(CommandResult);

            var openCommandMethodResultInvokerType = typeof(ResultInvoker<,>);
            var closedCommandMethodResultInvokerType =
                openCommandMethodResultInvokerType.MakeGenericType(closedCommandMethodResultType, closedDomainResultType);

            registry.For(closedActionMethodInvokerType).Use(closedCommandMethodResultInvokerType);

            var openResultProcessor = typeof(IResultProcessor<,>);
            var closedResultProcessor =
                openResultProcessor.MakeGenericType(closedCommandMethodResultType, closedDomainResultType);

            var openCommandMethodResultProcessorType = typeof(CommandResultProcessor<>);
            var closedCommandMethodResultProcessorType =
                openCommandMethodResultProcessorType.MakeGenericType(CommandType);

            registry.For(closedResultProcessor).Use(closedCommandMethodResultProcessorType);
        }
开发者ID:basicdays,项目名称:Guidelines,代码行数:27,代码来源:MvcCommandRegistrar.cs


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