コード例 #1
0
 //3.  Raise Event - using the statement RaisEvent+name of the event
 public void OnSendTakeOff(TakeOffEventArgs e)
 {
     if (SendTakeOffEvent != null)
     {
         SendTakeOffEvent(this, e);
     }
 }
コード例 #2
0
        /// <summary>
        /// Method provides event handler for the start button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>+-
        private void btnStart_Click(object sender, RoutedEventArgs e)
        {
            cmbStatus.IsEnabled = true;
            btnLand.IsEnabled   = true;
            btnStart.IsEnabled  = false;

            TakeOffEventArgs takeOfArgs = new TakeOffEventArgs(FlightCode, NavCourse, DateTime.Now.ToString());

            OnSendTakeOff(takeOfArgs);
            MessageBox.Show("Flight No is:" + FlightCode);
        }
コード例 #3
0
 /// <summary>
 /// Method handles the Output for the takeoff
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 public void OutputTakeOff(object source, TakeOffEventArgs e)
 {
     lvFlights.Items.Add(new { FlightCode = e.FlightCode, Status = e.FlightStatus, Time = e.FlightTime });
 }