本文整理汇总了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);
}
示例2: Process
public void Process(Type type, Registry registry)
{
if (IsConcreteClass(type))
{
registry.AddType(type, type);
}
}
示例3: Process
public void Process(Type type, Registry registry)
{
if (PluggableAttribute.MarkedAsPluggable(type))
{
registry.AddType(type);
}
}
示例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);
}
}
示例5: Process
public void Process(Type type, Registry registry)
{
if (type.IsClosedTypeOf(openGenericInterfaceCollectionType))
{
registry.AddType(openGenericInterfaceCollectionType, type);
}
}
示例6: Process
public void Process(Type type, Registry registry)
{
if (type.ImplementsInterface<ILatticeGroup>() && !type.IsAbstract && type.IsPublic)
{
registry.AddType(typeof(ILatticeGroup), type, type.FullName);
}
}
示例7: Process
public void Process(Type type, Registry registry)
{
if (!type.IsAbstract && typeof(IController).IsAssignableFrom(type))
{
registry.AddType(type, type);
}
}
示例8: Process
public void Process(Type type, Registry registry)
{
var validatorTypes = type.FindInterfacesThatClose(typeof(IValidator<>));
foreach(var validatorType in validatorTypes)
registry.AddType(validatorType, type);
}
示例9: Process
public void Process(Type type, Registry registry)
{
Type interfaceType = type.FindFirstInterfaceThatCloses(_openGenericType);
if (interfaceType != null)
{
registry.AddType(interfaceType, type);
}
}
示例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);
}
示例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);
});
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}