/// <summary> /// 获得枚举项附加属性的描述信息属性 /// </summary> /// <param name="enumItem">枚举项</param> /// <returns>描述信息属性,若该附加属性没有定义,则返回null</returns> /// <remarks>获得枚举项的附加属性,若该附加属性没有定义,则返回null /// <code source="..\Framework\TestProjects\DeluxeWorks.Library.Test\Core\EnumItemDescriptionAttributeTest.cs" region = "GetAttributeTest" lang="cs" title="得到枚举项的描述信息属性" /> /// </remarks> public static EnumItemDescriptionAttribute GetAttribute(System.Enum enumItem) { return(AttributeHelper.GetCustomAttribute <EnumItemDescriptionAttribute>(enumItem.GetType().GetField(enumItem.ToString()))); }