public void SearchCommandExecute(string text) { SearchedAirlineCompany = wpfFacade.GetAirlineCompanyByName(text); Flights.Clear(); if (SearchedAirlineCompany is null == false) { Flights.AddRange(wpfFacade.GetFlightsByAirlineCompanyId(SearchedAirlineCompany)); } }
protected async override void OnInitialize() { Flights.AddRange(await bookedFlightsService.GetFlightsAsync()); if (VoiceCommandName == "Status") { var booking = Flights.First(b => b.Name == Booking); SelectFlightAsync(booking, true); } }
public void Search() { Flights.Clear(); var flights = Enumerable.Range(0, 10) .Select(i => new FlightViewModel { Arrives = SelectedArrival, Departs = SelectedDeparture, Name = String.Format("METRO {0}", i) }); Flights.AddRange(flights); }
private void OpenSavedAOI_Execute(object aoi) { if (aoi is AreaOfInterest aoiObj) { if (!AreasOfInterest.Any((a) => a.Name == aoiObj.Name)) { CmdCleanMap_Execute(null); AreasOfInterest.Add(aoiObj); Flights.AddRange(aoiObj.Flights); } NotifyPropertyChanged("AreasOfInterest"); NotifyPropertyChanged("Flights"); RenderMap(); } }
public Scenario1() { Airplane1 = new Airplane { Label = "Airplane1" }; Airplane2 = new Airplane { Label = "Airplane2" }; Airplanes.Add(Airplane1); Airplanes.Add(Airplane2); Flights.AddRange(new Flight[] { new Flight { Number = "FLIGHT01", Airplane = Airplane1, Starts = new DateTime(2018, 1, 1, 13, 57, 0), Ends = new DateTime(2018, 1, 1, 15, 33, 0), }, new Flight { Number = "FLIGHT02_COLLIDINGWITH01", Airplane = Airplane1, Starts = new DateTime(2018, 1, 1, 14, 30, 0), Ends = new DateTime(2018, 1, 1, 17, 33, 0), }, new Flight { Number = "FLIGHT03", Airplane = Airplane2, Starts = new DateTime(2018, 1, 1, 14, 30, 0), Ends = new DateTime(2018, 1, 1, 17, 33, 0), } }); foreach (var ap in Airplanes) { ap.Flights = Flights.Where(x => x.Airplane == ap).ToList(); } }
public void SetFligths(List <Flight> flights) { Flights.AddRange(flights); }