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