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


C# Registry.AddType方法代码示例

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


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

示例1: Process

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

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

示例2: Process

 public void Process(Type type, Registry registry)
 {
     if (IsConcreteClass(type))
     {
         registry.AddType(type, type);
     }
 }
开发者ID:DerAlbertCom,项目名称:AdvancedMVC,代码行数:7,代码来源:ConcreteTypeConvention.cs

示例3: Process

 public void Process(Type type, Registry registry)
 {
     if (PluggableAttribute.MarkedAsPluggable(type))
     {
         registry.AddType(type);
     }
 }
开发者ID:hp4711,项目名称:structuremap,代码行数:7,代码来源:PluggableAttributeScanner.cs

示例4: 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

示例5: Process

 public void Process(Type type, Registry registry)
 {
     if (type.IsClosedTypeOf(openGenericInterfaceCollectionType))
     {
         registry.AddType(openGenericInterfaceCollectionType, type);
     }
 }
开发者ID:chester89,项目名称:Modeler,代码行数:7,代码来源:CommonRegistry.cs

示例6: Process

 public void Process(Type type, Registry registry)
 {
     if (type.ImplementsInterface<ILatticeGroup>() && !type.IsAbstract && type.IsPublic)
     {
         registry.AddType(typeof(ILatticeGroup), type, type.FullName);
     }
 }
开发者ID:flq,项目名称:SoftLattice,代码行数:7,代码来源:LatticeGroupRegistrationConvention.cs

示例7: Process

 public void Process(Type type, Registry registry)
 {
     if (!type.IsAbstract && typeof(IController).IsAssignableFrom(type))
     {
        registry.AddType(type, type);
     }
 }
开发者ID:noug,项目名称:neuesinaspnetmvc3rc,代码行数:7,代码来源:ControllerRegistryConvention.cs

示例8: 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

示例9: Process

 public void Process(Type type, Registry registry)
 {
     Type interfaceType = type.FindFirstInterfaceThatCloses(_openGenericType);
     if (interfaceType != null)
     {
         registry.AddType(interfaceType, type);
     }
 }
开发者ID:JonKruger,项目名称:MvcStarterProject,代码行数:8,代码来源:CloseInterfaceConventionScanner.cs

示例10: Process

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

            var name = type.Name.Replace("ResponseWriter", "");

            registry.AddType(typeof (IResponseWriter), type, name);
        }
开发者ID:bnathyuw,项目名称:Restful-Simple-MVC,代码行数:8,代码来源:ResponseWriterConvention.cs

示例11: ScanTypes

 public void ScanTypes(TypeSet types, Registry registry)
 {
     types.FindTypes(TypeClassification.Concretes).Where(Matches).Each(type =>
     {
         var name = _getName(type);
         registry.AddType(GetLeastSpecificButValidType(_pluginType, type), type, name);
     });
 }
开发者ID:slahn,项目名称:structuremap,代码行数:8,代码来源:FindAllTypesFilter.cs

示例12: Process

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

            var name = type.Name.Replace("StatusCodeTranslator", "");

            registry.AddType(typeof (IStatusCodeTranslator), type, name);
        }
开发者ID:bnathyuw,项目名称:Restful-Simple-MVC,代码行数:8,代码来源:StatusCodeProviderConvention.cs

示例13: Process

 public void Process(Type type, Registry registry)
 {
     if (type.CanBeCastTo(_pluginType) && Constructor.HasConstructors(type))
     {
         string name = _getName(type);
         registry.AddType(GetLeastSpecificButValidType(_pluginType, type), type, name);
     }
 }
开发者ID:Princa,项目名称:structuremap,代码行数:8,代码来源:FindAllTypesFilter.cs

示例14: ProcessFacade

        public void ProcessFacade(Type type, Registry registry, Type facadeInterface, Type genericFacadeInterface, Type concreteFacade)
        {
            if (type.ImplementsInterfaceTemplate(genericFacadeInterface))
            {
                var interfaceType = type.FindFirstInterfaceThatCloses(genericFacadeInterface);
                var commandMessageTypes = interfaceType.GetGenericArguments();

                var closesQuerryProcessor =
                    concreteFacade.MakeGenericType(commandMessageTypes);

                registry.AddType(closesQuerryProcessor);
                registry.AddType(interfaceType, type);
            }
            if (facadeInterface.IsAssignableFrom(type) && !type.IsInterface)
            {
                registry.AddType(facadeInterface, type);
            }
        }
开发者ID:basicdays,项目名称:Guidelines,代码行数:18,代码来源:FacadeConvention.cs

示例15: Process

 public void Process(Type type, Registry registry)
 {
     bool hasInjectAttribute = type.GetCustomAttributes(false)
                                   .Any(attr => attr.Equals(typeof(InjectAttribute)));
     if (hasInjectAttribute)
     {
         registry.AddType(type);
     }
 }
开发者ID:marcelopuppin,项目名称:MicropostMVC,代码行数:9,代码来源:SmInjectAttributeConvention.cs


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