Esempio n. 1
0
    public void Set(TimeSpan timeSpan)
    {
        if (timeSpan < TimeSpan.Zero)
        {
            return;
        }

        Clock = timeSpan;

        ClockChanged?.Invoke(this, new ShotClockStateChangedEventArgs(this));
    }
Esempio n. 2
0
    public void SetState(bool active)
    {
        if (IsRunning == active)
        {
            return;
        }

        IsRunning = active;

        if (!IsRunning)
        {
            _timer.Stop();
        }
        else
        {
            _timer.Start();
        }

        ClockChanged?.Invoke(this, new ShotClockStateChangedEventArgs(this));
    }
Esempio n. 3
0
 protected void OnClockChanged(DateTime clock)
 {
     ClockChanged?.Invoke(clock);
 }