Exemplo 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);
        }
Exemplo 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));
        }
Exemplo n.º 3
0
 public static T ToEnumValue(string enumDisplayName)
 {
     return(DisplayWrapper <T> .DisplayNameToEnumValue(enumDisplayName));
 }