コード例 #1
0
        private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            Flight selectedFlight = DGFlights.SelectedItem as Flight;

            if (SelectedFlight(selectedFlight))
            {
                Flight            oldFlight = selectedFlight.Clone() as Flight;
                EditFlightsWindow efw       = new EditFlightsWindow(selectedFlight, EditFlightsWindow.Option.EDIT);
                if (efw.ShowDialog() != true)
                {
                    int index = IndexOfSelectedFlight(oldFlight.FlightNumber);
                    Data.Instance.Flights[index] = oldFlight;
                }
                else
                {
                    selectedFlight.ChangeFlight();
                }
            }
        }
コード例 #2
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            EditFlightsWindow efw = new EditFlightsWindow(new Flight(), EditFlightsWindow.Option.ADDING);

            efw.ShowDialog();
        }