예제 #1
0
        /// <summary>
        /// Reacts on the <see cref="CountDown.TimeIsUp"/> event.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        public void OtherReaction(object sender, TimeIsUpEventArgs e)
        {
            if (sender is null || e is null)
            {
                throw new ArgumentException("Wrong EventArgs");
            }

            Console.WriteLine();
            Console.WriteLine($"< Subscriber Other Reaction > has been triggered by {sender.ToString()}");
            Console.WriteLine($"Countdown started: {e.CountDownStarted.ToString("hh:mm:ss", CultureInfo.InvariantCulture)}");
            Console.WriteLine($"Countdown finished: {e.CountDownFinished.ToString("hh:mm:ss", CultureInfo.InvariantCulture)}");
        }
예제 #2
0
 /// <summary>
 /// Fires the <see cref="TimeIsUp"/> event.
 /// </summary>
 /// <param name="e">Arguments for the event.</param>
 protected virtual void OnTimeIsUp(TimeIsUpEventArgs e)
 {
     this.TimeIsUp?.Invoke(this, e);
 }