Esempio n. 1
0
        public static Dictionary <T, string> GetTagsDictionary()
        {
            Dictionary <T, string> ret = new Dictionary <T, string>();

            foreach (T val in Enum.GetValues(typeof(T)))
            {
                ret.Add(val, DisplayWrapper <T> .GetTag(val));
            }
            return(ret);
        }
Esempio n. 2
0
        public static T SplitDelimitedTagMatchToEnumValue(char delimiter, string match)
        {
            Dictionary <T, string> temp = DisplayWrapper <T> .GetTagsDictionary();

            foreach (T key in temp.Keys)
            {
                string[] arr = temp[key].Split(delimiter);
                foreach (string s in arr)
                {
                    if (s.ToLower() == match.Replace(".", "").ToLower())
                    {
                        return(key);
                    }
                }
            }

            return(default(T));
        }
Esempio n. 3
0
 public static T ToEnumValue(string enumDisplayName)
 {
     return(DisplayWrapper <T> .DisplayNameToEnumValue(enumDisplayName));
 }