コード例 #1
0
        public static Type GetGeneratorClass(this Enum value)
        {
            FieldInfo field;

            if (GetFieldInfo(value, out field))
            {
                return(null);
            }

            GridTypeAttribute attr =
                Attribute.GetCustomAttribute(field, typeof(GridTypeAttribute)) as GridTypeAttribute;

            return(attr?.GeneratorClass);
        }
コード例 #2
0
        public static string GetTitle(this Enum value)
        {
            FieldInfo field;

            if (GetFieldInfo(value, out field))
            {
                return(null);
            }

            GridTypeAttribute attr =
                Attribute.GetCustomAttribute(field, typeof(GridTypeAttribute)) as GridTypeAttribute;

            return(attr?.Title);
        }