Ejemplo n.º 1
0
        public static Type ResolveNestedGenericType(Type containingType, Type baseType, TypeLookup typeLookup, LightList <string> namespaces)
        {
            FilterAssemblies();

            if (!baseType.IsGenericTypeDefinition)
            {
                throw new TypeResolutionException($"{baseType} is not a generic type definition but we are trying to resolve a generic type with it because generic arguments were provided");
            }

            if (!baseType.IsGenericTypeDefinition)
            {
                throw new TypeResolutionException($"{baseType} is not a generic type definition but we are trying to resolve a generic type with it because generic arguments were provided");
            }

            if (typeLookup.generics == null || typeLookup.generics.Count == 0)
            {
                throw new TypeResolutionException($"Tried to resolve generic types from {baseType} but no generic types were given in the {nameof(typeLookup)} argument");
            }

            return(ReflectionUtil.CreateNestedGenericType(containingType, baseType, ResolveGenericTypes(typeLookup, namespaces)));
        }