- Timestamp:
- Mar 8, 2012, 11:19:12 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PiwigoLib/PiwigoLib/DTO/Helper/PwgEnumHelper.cs
r11850 r13520 2 2 using System.Reflection; 3 3 using System.Xml.Serialization; 4 using System.Collections.Generic; 4 5 5 6 namespace Com.Piwigo.Lib.DTO.Helper 6 7 { 7 internalstatic class PwgEnumHelper<T>8 public static class PwgEnumHelper<T> 8 9 { 9 10 static PwgEnumHelper() … … 42 43 throw new ArgumentException(String.Format("PwgEnumHelper<{0}>.enumValueOf({1}): The String is not a description or value of the specified enum.", typeof(T).Name, value)); 43 44 } 45 46 public static List<KeyValuePair<T, String>> buildChoiceList() 47 { 48 List<KeyValuePair<T, String>> lst = new List<KeyValuePair<T, String>>(); 49 50 foreach (T item in Enum.GetValues(typeof(T))) 51 { 52 lst.Add(new KeyValuePair<T, String>(item, StringValueOf(item))); 53 } 54 55 return lst; 56 } 44 57 } 45 58 }
Note: See TracChangeset
for help on using the changeset viewer.