protected virtual void OnNotification(object sender, TimerEventArgs args) { var eventHandler = Notification; eventHandler?.Invoke(sender, args); }
private static void PrintInfo(object sender, TimerEventArgs e) { Console.WriteLine($"Message: {e.Message}, Occurring time: {e.EventOccurrenceTime.ToLocalTime()}."); }
/// <summary> /// Event handler. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The object that contains event data.</param> public void OnTimeIsUp_Handler(object sender, TimerEventArgs e) { Console.WriteLine($"Alarm rings! {e.Message}"); }
public void OnTimeOut(int span) { TimerEventArgs e = new TimerEventArgs(span); TimeOut(this, e); }
/// <summary> /// Event handler /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The object that contains event data.</param> public void OnTimeIsUp(object sender, TimerEventArgs e) => this.TimeIsUp?.Invoke(sender, e);
protected virtual void OnNotification(object sender, TimerEventArgs args) { EventHandler <TimerEventArgs> temp = Notification; temp?.Invoke(sender, args); }