示例#1
0
 private List <TypeModel> GetGenericParameters(MethodBase m, Dictionary <string, TypeModel> beans)
 {
     return(m.IsGenericMethodDefinition ?
            m.GetGenericArguments().Select(t => TypeModel.GetTypeFromBeans(t, beans))
            .ToList() :
            null);
 }
示例#2
0
        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));
        }
示例#3
0
 private List <TypeModel> ExtractGenerics(Type type, Dictionary <string, TypeModel> beans)
 {
     return(type
            .GetGenericArguments()
            .Select(t => TypeModel.GetTypeFromBeans(t, beans))
            .ToList());
 }
示例#4
0
        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();
        }
示例#5
0
        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));
        }
示例#6
0
 private List <TypeModel> ExtractInterfaces(Type t, Dictionary <string, TypeModel> beans)
 {
     return(t.GetInterfaces().Select(i => TypeModel.GetTypeFromBeans(i, beans)).ToList());
 }