コード例 #1
0
        /// <summary>
        /// Event start
        /// </summary>
        /// <param name="seconds">Start parameter</param>
        public void SimulateTimeOut(int seconds)
        {
            Countdown.Start(seconds);
            var e = new NewTimeOutEventArgs(seconds);

            OnNewTimeOut(e);
        }
コード例 #2
0
        /// <summary>
        /// Method for event execution
        /// </summary>
        /// <param name="e">Exemplar of class wiht additional ingo</param>
        protected virtual void OnNewTimeOut(NewTimeOutEventArgs e)
        {
            var temp = NewTimeOut;

            temp?.Invoke(this, e);
        }
コード例 #3
0
 private void FirstSubscriberMsg(object sender, NewTimeOutEventArgs e)
 {
     Console.WriteLine("Time is out (message from first subscriber)");
     Console.WriteLine($"It took: {e.Seconds} second(s)");
 }