private async void timer_Tick(object sender, EventArgs e) { remainingTime = endDate - DateTime.UtcNow; int angle = (int)(360.0 * (remainingTime.TotalSeconds / totalTime.TotalSeconds)); if (remainingTime > TimeSpan.FromSeconds(1)) { cpsBar.Text = remainingTime.ToString(@"mm\:ss"); cpsBar.Value = angle; await Task.Delay(1000); cpsBar.AnimationSpeed = 0; } else { timer.Enabled = false; if (intervalType == IntervalType.Work) { playSound(Pomodoro.WorkComplatedSoundIndex); Pomodoro.ComplatedWorksCount++; } else { playSound(Pomodoro.EndBreakSoundIndex); Pomodoro.EndBreakCount++; Pomodoro.TotalPomodoroCount++; } showValues(); FilePomodoro.WriteToday(); cpsBar.Text = done; changeIntervalType(); changMediaType(); setToolEnable(true); updateTheme(); updateTodayDesign(); cpsBar.Value = 0; this.WindowState = this.WindowState; if (Pomodoro.AutoStart == true) { PlayPause_Click(sender, e); } //Pomodoro.WorkTime += Pomodoro.WorkInterval; //Pomodoro.TotalWorkTime += Pomodoro.WorkInterval; } }
private void Save_Click(object sender, EventArgs e) { FilePomodoro.WriteToday(); }