private void btnReset_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("This will reset the backup timer. Do you want to also add the time to the currently running timer?", "Reset", MessageBoxButtons.YesNoCancel); if (dialogResult == DialogResult.Yes) { foreach (var issue in issueControls) { issue.WatchTimer.AddWhenRunning(backupTimer.GetState().TotalTime.TotalMilliseconds); issue.UpdateOutput(); } ResetBackupTimer(); } else if (dialogResult == DialogResult.No) { ResetBackupTimer(); } }
private void tbTime_TextChanged(object sender, EventArgs e) { // Ignore if programatically changing value (from timer) if (ignoreTextChange) { return; } TimeSpan time = JiraHelpers.JiraTimeToTimeSpan(tbTime.Text); if (time.TotalMilliseconds == 0) { return; } TimerState state = WatchTimer.GetState(); state.TotalTime = time; state.StartTime = DateTime.Now; WatchTimer.SetState(state); }