public void AddFacility(RouteFacility facility)
        {
            if (Facilities.Exists(f => f.Type == facility.Type))
            {
                Facilities.RemoveAll(f => f.Type == facility.Type);
            }

            Facilities.Add(facility);
        }
 public RouteFacility GetFacility(RouteFacility.FacilityType type)
 {
     return Facilities.Find(f => f.Type == type);
 }
Exemplo n.º 3
0
        public AirlineClassFacilityMVVM(RouteFacility.FacilityType type)
        {
            Facilities = new ObservableCollection<RouteFacility>();

            Type = type;
        }
 //returns all route facilities for a given airline and type
 public static List<RouteFacility> GetRouteFacilities(Airline airline, RouteFacility.FacilityType type)
 {
     return RouteFacilities.GetFacilities(type).FindAll(f => f.Requires == null || airline.Facilities.Contains(f.Requires));
 }
 //returns all facilities for a specific type
 public static List<RouteFacility> GetFacilities(RouteFacility.FacilityType type)
 {
     return _facilities.FindAll(f => f.Type == type);
 }
 //returns the basic facility for a specific type
 public static RouteFacility GetBasicFacility(RouteFacility.FacilityType type)
 {
     return _facilities.FindAll(f => f.Type == type).OrderBy(f => f.ServiceLevel).First();
 }
 public static void AddFacility(RouteFacility facility)
 {
     _facilities.Add(facility);
 }
Exemplo n.º 8
0
        public MVVMRouteFacility(RouteFacility.FacilityType type, List<RouteFacility> facilities)
        {
            Facilities = new ObservableCollection<RouteFacility>();

            Type = type;

            foreach (RouteFacility facility in facilities)
                Facilities.Add(facility);

            SelectedFacility = Facilities.OrderBy(f => f.ServiceLevel).First();
        }