private void OnTick() { if (IsRunning) { TimerTickEvent?.Invoke(this, new UITimerTickEventArgs { RemainningTime = remainningTime }); } }
/// <summary> /// I use delegate to reach the picturebox of the form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void ActualClockBitmap(object sender, EventArgs e) { ActualClockSight(); if (TimerTickEvent != null) { TimerTickEvent.Invoke(ClockBitmap); } }
protected virtual void HandleTimerTick(TimerTickEvent e) { try { EventHandler <TimerTickEvent> handler = OnTimerTick; if (handler != null) { handler(this, e); } } catch { } }
public void OnTimerTick(float f) { TimerTickEvent?.Invoke(f); }