void SwitchTimer() { if (current == taskTime) { RepeatTimeLeft.Value--; if (RepeatTimeLeft.Value <= 0) { current = longBreakTime; } else { current = breakTime; } } else if (current == breakTime) { current = taskTime; } else if (current == longBreakTime) { Stop(); Reset(); Phase.Value = TimerPhase.IsIdle; return; } Stop(); ResetToDestination(current); }
public override void Reset() { current = taskTime; RepeatTimeLeft.Value = RepeatTime; ResetToDestination(current); }
public PomodoroTimer(TimerTime taskTime, TimerTime breakTime, int repeat, TimerTime longBreakTime) : base() { this.taskTime = taskTime; this.breakTime = breakTime; this.RepeatTime = repeat; this.longBreakTime = longBreakTime; Reset(); CountdownEnd.Subscribe(x => { if (x) { SwitchTimer(); } }); }
void ResetToDestination(TimerTime destination) { Hour = destination.Hour; Minute = destination.Minute; Second = destination.Second; }