= = ==
[EnumDescription( = = ==
是自己寫的一個類,下面會貼上源碼。
txt = EnumDescription.GetEnumText( txt = = EnumDescription.GetFieldTexts( =EnumDescription.GetFieldTexts(= =
源碼
[AttributeUsage(AttributeTargets.Field | EnumDescription( enumDisplayText, .enumDisplayText =.enumRank = EnumDescription( (enumDisplayText, { { { ()fieldIno.GetValue( { =========================================對枚舉描述屬性的解釋相關函數 System.Collections.Hashtable cachedEnum = = (EnumDescription[])enumType.GetCustomAttributes((EnumDescription), ( eds.Length != ) eds[ GetFieldText( = ( EnumDescription ed ( ed.fieldIno.Name == enumValue.ToString() ) = ( cachedEnum.Contains(enumType.FullName) == == ( FieldInfo fi [] eds = fi.GetCustomAttributes((EnumDescription), ( eds.Length != ) ]).fieldIno == ( descriptions.Length <= ) NotSupportedException( + enumType.Name + ( m = ; m < descriptions.Length; m++ ( sortType == SortType.Default ) ( n = m; n < descriptions.Length; n++ swap = ( .Compare(descriptions[m].EnumDisplayText, descriptions[n].EnumDisplayText) > ) swap = ( descriptions[m].EnumRank > descriptions[n].EnumRank ) swap = ===