Ignore:
Timestamp:
Mar 8, 2012, 11:19:12 PM (12 years ago)
Author:
bayral
Message:

new project for windows live publish plugin
Well advance single uploader

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PiwigoLib/PiwigoLib/DTO/Helper/PwgEnumHelper.cs

    r11850 r13520  
    22using System.Reflection;
    33using System.Xml.Serialization;
     4using System.Collections.Generic;
    45
    56namespace Com.Piwigo.Lib.DTO.Helper
    67{
    7     internal static class PwgEnumHelper<T>
     8    public static class PwgEnumHelper<T>
    89    {
    910        static PwgEnumHelper()
     
    4243            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));
    4344        }
     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        }
    4457    }
    4558}
Note: See TracChangeset for help on using the changeset viewer.