/// <summary> /// Starts this instance. /// </summary> public void Start() { TimerTickEvenArgs tickArgs = new TimerTickEvenArgs("Тик...так"); while (Time != 0) { Thread.Sleep(TimeSpan.FromSeconds(1)); Time--; OnTick(this, tickArgs); } OnElapsed(this, new TimerElapsedEvenArgs()); }
/// <summary> /// Called when [tick]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="eventArgs">The event arguments.</param> private void OnTick(object sender, TimerTickEvenArgs eventArgs) { TimerTick?.Invoke(this, eventArgs); }