Esempio n. 1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="MultiChecker" /> class.
 /// </summary>
 /// <param name="assembly">The assembly.</param>
 /// <param name="interfaceType">Type of the interface.</param>
 /// <param name="checkerType">Type of the checker.</param>
 public MultiChecker(IAssembly assembly, Type interfaceType, Type checkerType)
 {
     _concreteGenericType = checkerType;
     foreach (var type in assembly.GetAllReferencedTypes())
     {
         Type specializedGeneric;
         if (interfaceType.GetTypeInfo().ContainsGenericParameters)
         {
             specializedGeneric = interfaceType.MakeGenericType(type);
         }
         else
         {
             specializedGeneric = interfaceType;
         }
         if (specializedGeneric.IsAssignableFrom(type))
         {
             {
                 if (!type.GetTypeInfo().IsInterface&& !type.GetTypeInfo().IsAbstract&&
                     !type.IsArray && !type.GetTypeInfo().IsValueType&&
                     !type.IsPointer && !typeof(Delegate).IsAssignableFrom(type))
                 {
                     _typesToCheck.Add(type);
                 }
             }
         }
     }
 }