public static void break_start() { if (!currentlyBreaking) { //Create new breaking object timeTrackingBreak newBreak = new timeTrackingBreak(); currentBreak = newBreak; //Add mark (break start) timeTrackingMark newMark = new timeTrackingMark(totalTimer, "Break #" + Convert.ToString(newBreak.breakIndex) + " started", true); currentBreak.startMark = newMark.actualIndex; newMark.associatedBreak = newBreak; } currentlyBreaking = true; mainInstance.la_status_break.ForeColor = System.Drawing.Color.Red; }
public static void break_stop() { if (currentlyBreaking) { currentBreak.endBreak(); previousBreaks.Add(currentBreak); //Add mark (break end) timeTrackingMark newMark = new timeTrackingMark(totalTimer, "Break #" + Convert.ToString(currentBreak.breakIndex) + " ended"); currentBreak.endMark = newMark.actualIndex; newMark.associatedBreak = currentBreak; //Reset currentbreak currentBreak = null; } currentlyBreaking = false; mainInstance.la_status_break.ForeColor = System.Drawing.Color.FromArgb(64, 64, 64); }
public static void newProject() { //Reset vars TimeTracking.projectConfig = null; currentTrackingState = timeTrackingStates.inactive; totalTimer = 0; breakingTimeAccumulated = 0; currentlyBreaking = false; currentBreak = null; previousBreaks = new List<timeTrackingBreak>(); marks = new List<timeTrackingMark>(); currentDeadlineState = deadlineStates.normal; mainInstance.dgv_marks.Rows.Clear(); //Reset vars for other classes timeTrackingBreak.index = 0; timeTrackingMark.index = 0; //Reset timers and vars mainInstance.timer_tracker.Enabled = false; mainInstance.la_totalTimer.Text = "00:00:00"; mainInstance.la_episodeTimer.Text = "00:00:00"; mainInstance.la_breakTimer.Text = "00:00:00"; mainInstance.la_deadlineTimer.Text = "00:00:00"; //Set colors to normal. mainInstance.la_status_tracking.ForeColor = System.Drawing.Color.FromArgb(64, 64, 64); mainInstance.la_status_inactive.ForeColor = System.Drawing.Color.FromArgb(255, 255, 255); mainInstance.la_status_break.ForeColor = System.Drawing.Color.FromArgb(64, 64, 64); mainInstance.la_status_deadline.ForeColor = System.Drawing.Color.FromArgb(64, 64, 64); //SHOW Settings form settingsInstance = new frm_settings(); settingsInstance.Show(); settingsShown = true; mainInstance.SendToBack(); settingsInstance.Activate(); }