コード例 #1
0
        public static Type GetRealyType(FieldType fieldType)
        {
            FieldInfo      fieldInfo = fieldType.GetType().GetField(fieldType.ToString());
            FieldRealyType realyType = fieldInfo.GetCustomAttribute <FieldRealyType>();

            return(realyType?.RealyType);
        }
コード例 #2
0
        public static bool IsStringType(FieldType fieldType)
        {
            FieldRealyType realyTypeAttr = typeof(FieldType).GetField(fieldType.ToString()).GetCustomAttribute <FieldRealyType>();

            if (realyTypeAttr != null && realyTypeAttr.RealyType == typeof(string))
            {
                return(true);
            }
            return(false);
        }
コード例 #3
0
        public static bool IsNumberType(FieldType fieldType)
        {
            FieldRealyType realyTypeAttr = typeof(FieldType).GetField(fieldType.ToString()).GetCustomAttribute <FieldRealyType>();

            if (realyTypeAttr != null && realyTypeAttr.RealyType.IsValueType &&
                realyTypeAttr.RealyType.IsPrimitive)
            {
                return(true);
            }
            return(false);
        }