Exemple #1
0
        /// <summary>
        /// btnDeserialize click event handler. Uses FlightFactory object to read the flights.xml
        /// file and create a list of flight objects. It then displays the list of flight objects
        /// in a listbox.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDeserialize_Click(object sender, EventArgs e)
        {
            lstbxFlightSchedules.Items.Clear();
            temp.DeSerialize();
            List <Flight> flights = temp.GetFlights();

            foreach (Flight a in flights)
            {
                lstbxFlightSchedules.Items.Add(a);
            }
        }
Exemple #2
0
        private void btnCreateFlights_Click(object sender, EventArgs e)
        {
            FlightFactory test = new FlightFactory();

            test.CreateFlights();
            List <Flight> t = test.GetFlights();

            foreach (Flight i in t)
            {
                string flight = i.ToString();
                listBox1.Items.Add(flight);
            }
        }