Beispiel #1
0
 /// <summary>
 /// 获取描述,使用System.ComponentModel.Description特性设置描述
 /// </summary>
 /// <typeparam name="TEnum">枚举类型</typeparam>
 /// <param name="member">成员名、值、实例均可</param>
 public static string GetDescription <TEnum>(object member)
 {
     return(Reflection.GetDescription <TEnum>(GetName <TEnum>(member)));
 }
Beispiel #2
0
 /// <summary>
 /// 获取描述,使用System.ComponentModel.Description特性设置描述
 /// </summary>
 /// <param name="type">枚举类型</param>
 /// <param name="member">成员名、值、实例均可</param>
 public static string GetDescription(Type type, object member)
 {
     return(Reflection.GetDescription(type, GetName(type, member)));
 }