Exemplo n.º 1
0
        /// <summary>
        /// Delay the plane by X hours
        /// </summary>
        /// <param name="hours"></param>
        public void Delay(int hours)
        {
            IsLate = true;

            // Set dates for event
            DateTime old = Arrival;

            Arrival = Arrival.AddHours(hours);

            // Create event args
            LateArrivalEventArgs e = new LateArrivalEventArgs
            {
                Flight  = this,
                Planned = old,
                Actual  = Arrival
            };

            // Invoke/trigger event
            this.OnLateArrival?.Invoke(this, e);
        }