コード例 #1
0
ファイル: LiveSplitState.cs プロジェクト: zment4/LiveSplit
 public void RegisterTimerModel(ITimerModel model)
 {
     model.OnSplit                    += (s, e) => OnSplit?.Invoke(this, e);
     model.OnSkipSplit                += (s, e) => OnSkipSplit?.Invoke(this, e);
     model.OnUndoSplit                += (s, e) => OnUndoSplit?.Invoke(this, e);
     model.OnStart                    += (s, e) => OnStart?.Invoke(this, e);
     model.OnReset                    += (s, e) => OnReset?.Invoke(this, e);
     model.OnPause                    += (s, e) => OnPause?.Invoke(this, e);
     model.OnUndoAllPauses            += (s, e) => OnUndoAllPauses?.Invoke(this, e);
     model.OnResume                   += (s, e) => OnResume?.Invoke(this, e);
     model.OnScrollUp                 += (s, e) => OnScrollUp?.Invoke(this, e);
     model.OnScrollDown               += (s, e) => OnScrollDown?.Invoke(this, e);
     model.OnSwitchComparisonPrevious += (s, e) => OnSwitchComparisonPrevious?.Invoke(this, e);
     model.OnSwitchComparisonNext     += (s, e) => OnSwitchComparisonNext?.Invoke(this, e);
 }
コード例 #2
0
        public void UndoAllPauses()
        {
            if (CurrentState.CurrentPhase == TimerPhase.Paused)
            {
                Pause();
            }

            var pauseTime = CurrentState.PauseTime ?? TimeSpan.Zero;

            if (CurrentState.CurrentPhase == TimerPhase.Ended)
            {
                CurrentState.Run.Last().SplitTime += new Time(pauseTime, pauseTime);
            }

            CurrentState.AdjustedStartTime = CurrentState.StartTime;
            OnUndoAllPauses?.Invoke(this, null);
        }
コード例 #3
0
 public void OnBaseUndoAllPauses(object sender, EventArgs e)
 {
     OnUndoAllPauses?.Invoke(sender, e);
 }