static string GetEnumDescription(Bootstarp图标样式类型 value) { Type enumType = typeof(Bootstarp图标样式类型); var name = Enum.GetName(enumType, Convert.ToInt32(value)); if (name == null) return string.Empty; object[] objs = enumType.GetField(name).GetCustomAttributes(typeof(DescriptionAttribute), false); if (objs == null || objs.Length == 0) { return string.Empty; } else { DescriptionAttribute attr = objs[0] as DescriptionAttribute; return attr.Description; } }
static string GetEnumDescription(Bootstarp图标样式类型 value) { Type enumType = typeof(Bootstarp图标样式类型); var name = Enum.GetName(enumType, Convert.ToInt32(value)); if (name == null) { return(string.Empty); } object[] objs = enumType.GetField(name).GetCustomAttributes(typeof(DescriptionAttribute), false); if (objs == null || objs.Length == 0) { return(string.Empty); } else { DescriptionAttribute attr = objs[0] as DescriptionAttribute; return(attr.Description); } }
public Bootstarp图标(Bootstarp图标样式类型 样式类型) : base("span") { this.样式类型 = 样式类型; 添加Css类("glyphicon"); }