예제 #1
0
 private static void ProcessUnresolvedTypes(ITypeRegistry typeRegistry)
 {
     foreach (TypeReference unresolvedType in
              typeRegistry.GetUnresolvedTypes())
     {
         if (IsObjectType(unresolvedType))
         {
             typeRegistry.RegisterType(
                 new TypeReference(typeof(ObjectType <>)
                                   .MakeGenericType(unresolvedType.ClrType)));
         }
         else if (IsInputObjectType(unresolvedType))
         {
             typeRegistry.RegisterType(
                 new TypeReference(typeof(InputObjectType <>)
                                   .MakeGenericType(unresolvedType.ClrType)));
         }
         else if (IsEnumType(unresolvedType))
         {
             typeRegistry.RegisterType(
                 new TypeReference(typeof(EnumType <>)
                                   .MakeGenericType(unresolvedType.ClrType)));
         }
     }
 }
예제 #2
0
 private void ProcessUnresolvedTypes(ITypeRegistry typeRegistry)
 {
     foreach (Type type in typeRegistry.GetUnresolvedTypes())
     {
         if (type.IsClass && !type.IsAbstract &&
             (type.IsPublic || type.IsNestedPublic))
         {
             typeRegistry.RegisterType(
                 new TypeReference(typeof(ObjectType <>)
                                   .MakeGenericType(type)));
         }
         else if (type.IsEnum && (type.IsPublic || type.IsNestedPublic))
         {
             typeRegistry.RegisterType(
                 new TypeReference(typeof(EnumType <>)
                                   .MakeGenericType(type)));
         }
     }
 }