예제 #1
0
    public void Set(TimeSpan timeSpan)
    {
        if (timeSpan < TimeSpan.Zero)
        {
            return;
        }

        Clock = timeSpan;

        ClockChanged?.Invoke(this, new ShotClockStateChangedEventArgs(this));
    }
예제 #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));
    }
예제 #3
0
 protected void OnClockChanged(DateTime clock)
 {
     ClockChanged?.Invoke(clock);
 }