Пример #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());
 }