Esempio n. 1
0
 private static void PrintRoomTypeList()
 {
     foreach (RoomTypes roomType in new[] { RoomTypes.Single, RoomTypes.Double, RoomTypes.Family })
     {
         Out(RoomType.Get(roomType));
     }
 }
Esempio n. 2
0
        private static RoomType GetRoomTypeFromUser()
        {
            var chosenType = In(new[] { "Single", "Double", "Family" },
                                validationFunction: (iter, item) => iter.ToLower().Contains(item.ToLower()));
            RoomTypes types;
            bool      success = RoomTypes.TryParse(chosenType, ignoreCase: true, result: out types);

            if (!success)
            {
                Out("General Failure.");
                return(null);
            }
            RoomType type = RoomType.Get(types);

            return(type);
        }