public static string GetTypeString(RecordType type)
        {
            Type                 t           = type.GetType();
            FieldInfo            info        = t.GetField(Enum.GetName(t, type));
            DescriptionAttribute description = (DescriptionAttribute)Attribute.GetCustomAttribute(info, typeof(DescriptionAttribute));

            return(description.Description);
        }
Example #2
0
        public static string ToString(this RecordType recordType)
        {
            var attributes = recordType.GetType().GetCustomAttributes(typeof(DescriptionAttribute), false);

            return(((DescriptionAttribute)attributes[0]).Short);
        }