public static BusSubType FromValue(string value) { foreach (BusSubType busSubType in BusSubType.Values()) { if (busSubType.Value().Equals(value)) { return(busSubType); } } throw new ArgumentException(value.ToString()); }
public static List <BusSubType> Values() { BusSubType busSubType = new BusSubType(); List <BusSubType> busSubTypeList = new List <BusSubType>(); foreach (FieldInfo field in busSubType.GetType().GetFields()) { busSubTypeList.Add((BusSubType)field.GetValue((object)busSubType)); } return(busSubTypeList); }