Exemplo n.º 1
0
 public static BusSubType FromValue(string value)
 {
     foreach (BusSubType busSubType in BusSubType.Values())
     {
         if (busSubType.Value().Equals(value))
         {
             return(busSubType);
         }
     }
     throw new ArgumentException(value.ToString());
 }
Exemplo n.º 2
0
        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);
        }