예제 #1
0
    public static string Display(this Enum t)
    {
        Type   type = t.GetType();
        string name = Enum.GetName(type, t);
        EnumDisplayAttribute enumDisplayAttribute = type.GetField(name).GetCustomAttributes(inherit: false).FirstOrDefault((object p) => p.GetType().Equals(typeof(EnumDisplayAttribute))) as EnumDisplayAttribute;

        if (enumDisplayAttribute != null)
        {
            return(enumDisplayAttribute.Display);
        }
        return(name);
    }
예제 #2
0
 public EnumDisplayField(EditableProperty property, EnumDisplayAttribute iconsAttribute, ThemeConfig theme)
 {
     this.property            = property;
     this.enumDisplayAttibute = iconsAttribute;
     this.theme = theme;
 }