コード例 #1
0
        private void WriteToFutureArrivalsBoard(FlightDTO flightDTO)
        {
            FutureArrivals.Add(flightDTO);
            StringBuilder sb = new StringBuilder("Future Arrivals:\n");

            foreach (var item in FutureArrivals)
            {
                string flight;
                if (!item.IsDeparture)
                {
                    flight = "Flight: " + item.FlightGuidAndType + " Start time: " + item.StartTime;
                    sb.Append(flight + "\n");
                }
            }
            if (FutureArrivals.Count == 0)
            {
                sb.Append("No future arrivals at the moment\n");
            }
            FutureArrivalsBoard = sb.ToString();
        }
コード例 #2
0
 private void UpdateFutureFlightsBoards(AirportStateDTO airportState)
 {
     foreach (var item in airportState.CurrentStationsState)
     {
         foreach (var departure in FutureDepartures)
         {
             if (item.Value == departure.FlightGuidAndType)
             {
                 FutureDepartures.Remove(departure);
                 break;
             }
         }
         foreach (var departure in FutureArrivals)
         {
             if (item.Value == departure.FlightGuidAndType)
             {
                 FutureArrivals.Remove(departure);
                 break;
             }
         }
     }
 }