Example #1
0
 //Update inbound and outbound plane lists.
 private void updateInOutbound()
 {
     if (lvwAirports.SelectedItem != null) //If an airport is selected.
     {
         Airport         selectedAP   = (Airport)lvwAirports.SelectedItem;
         List <Airplane> allAirplanes = m_ATCBiz.AirportStatus(selectedAP.AirportID); //All planes owned by airport.
         m_inbound  = new List <Airplane>();
         m_outbound = new List <Airplane>();
         foreach (Airplane ap in allAirplanes)
         {
             if (ap.State == 'I' || ap.State == 'L')
             {
                 m_outbound.Add(ap);                                     //Separate planes into correct lists.
             }
             else
             {
                 m_inbound.Add(ap);
             }
         }
         lvwInbound.ItemsSource  = m_inbound;
         lvwOutbound.ItemsSource = m_outbound;
     }
 }