/// <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); }
/// <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); }
private void FirstSubscriberMsg(object sender, NewTimeOutEventArgs e) { Console.WriteLine("Time is out (message from first subscriber)"); Console.WriteLine($"It took: {e.Seconds} second(s)"); }