private List <TypeModel> GetGenericParameters(MethodBase m, Dictionary <string, TypeModel> beans) { return(m.IsGenericMethodDefinition ? m.GetGenericArguments().Select(t => TypeModel.GetTypeFromBeans(t, beans)) .ToList() : null); }
private TypeModel GetBaseType(Type t, Dictionary <string, TypeModel> beans) { Type baseType = t.BaseType; bool ifNull = BaseType == null || baseType == typeof(Object) || baseType == typeof(ValueType) || baseType == typeof(Enum); return(ifNull ? null : TypeModel.GetTypeFromBeans(t, beans)); }
private List <TypeModel> ExtractGenerics(Type type, Dictionary <string, TypeModel> beans) { return(type .GetGenericArguments() .Select(t => TypeModel.GetTypeFromBeans(t, beans)) .ToList()); }
internal FieldModel(FieldInfo f, Dictionary <string, TypeModel> beans) { Name = f.Name; AccessLevel = GetAccessLevel(f); FieldType = TypeModel.GetTypeFromBeans(f.FieldType, beans); Attributes = f.GetAttributes(false).ToList(); }
private TypeModel GetReturnType(MethodBase m, Dictionary <string, TypeModel> beans) { MethodInfo methodInfo = m as MethodInfo; if (methodInfo == null) { return(null); } Type returnType = methodInfo.ReturnType; return(TypeModel.GetTypeFromBeans(returnType, beans)); }
private List <TypeModel> ExtractInterfaces(Type t, Dictionary <string, TypeModel> beans) { return(t.GetInterfaces().Select(i => TypeModel.GetTypeFromBeans(i, beans)).ToList()); }