public void Start() { timer = ThreadPoolTimer.CreatePeriodicTimer(Timer_Tick, TimeSpan.FromSeconds(1)); Status = TomatoStatus.Focus; PreviousStatus = Status; PomodoroCount = 1; step = 1; }
private void switchNone() { progressBar1.Value = 0; label3.Text = ""; timer1.Interval = 1000; button1.Text = "开始"; DoingStatus = TomatoStatus.None; UpdateLog("放弃"); }
private void switchLongRest() { progressBar1.Maximum = 15 * 60; progressBar1.Value = 0; label3.Text = "15:00"; timer1.Interval = 1000; button1.Text = "休息15分钟"; DoingStatus = TomatoStatus.HaveLongRest; UpdateLog(button1.Text); }
private void switchTomato() { progressBar1.Value = 0; progressBar1.Maximum = 25 * 60; progressBar1.Value = 0; label3.Text = "25:00"; timer1.Interval = 1000; button1.Text = "专注"; RestCount = 0; DoingStatus = TomatoStatus.EatingTomato; UpdateLog(button1.Text); }
private void switchFinishTask() { if (DoingStatus == TomatoStatus.EatingTomato) { goodTomato++; } progressBar1.Value = 0; label3.Text = ""; timer1.Interval = 1000; button1.Text = "开始"; DoingStatus = TomatoStatus.None; UpdateLog("完成任务【" + textBox_task.Text + "】"); notifyIcon1.ShowBalloonTip(1000, "Tomato", "完成任务【" + textBox_task.Text + "】", ToolTipIcon.Info); textBox_task.Text = ""; }
private void TimerComplete(object state) { PreviousStatus = Status; if (Status == TomatoStatus.Focus) { if (PomodoroCount >= 4) { Status = TomatoStatus.Waiting; PomodoroCount = 0; } else { Status = TomatoStatus.Free; } } else if (step < Replays * 2) { Status = TomatoStatus.Focus; PomodoroCount++; } step++; }