Exemplo n.º 1
0
        public void TimerStatusChange(ref TimeSpan timeSpan)
        {
            //change the status**************** NOT SURE IF THIS IS WORKING
            if (status)
            {
                TimerStatus = new TimerStatusClass(false);
            }
            else
            {
                TimerStatus = new TimerStatusClass(true);
            }

            status = TimerStatus.GetStatus();
            if (status)
            {
                //When I click start:

                //start timer
                timerForCurrentTask.Enabled = true;
                timerForBreaks.Enabled      = true;
                breakBar.Visible            = true;
                //Save time to log, and a variable
                //save current task to log and variable
                WriteToLog(true);
                //change button text to stop
                btnStartStop.Text = "Stop";
                //hide current task textbox
                tbCurrentTask.Visible = false;
                //show current task label
                lblCurrentTask.Visible = true;
                //show current task time
                lblCurrentTaskTime.Text    = "0h 0m 0s";
                lblCurrentTaskTime.Visible = true;
            }
            else
            {
                //When I click stop:

                //stop timer
                //save time span to variable and log
                timeSpan = DateTime.Now - TimerStatus.TimeOfEvent;
                timerForBreaks.Enabled = false;
                breakBar.Visible       = false;
                WriteToLog(false);
                //change button text to "start"
                btnStartStop.Text = "Start";
                // make current task text box visible
                tbCurrentTask.Visible = true;
                //make current task label invisible
                lblCurrentTask.Visible = false;
                // make timer invisible
                lblCurrentTaskTime.Visible = false;
            }
            btnStartStop.BackColor = TimerStatus.GetColor();
        }
Exemplo n.º 2
0
 private void TimeTrackerMain_Load(object sender, EventArgs e)
 {
     TimerStatus = new TimerStatusClass(false);
     status      = false;
     //change button text to "start"
     btnStartStop.Text = "Start";
     // make current task text box visible
     tbCurrentTask.Visible = true;
     //make current task label invisible
     lblCurrentTask.Visible = false;
     // make timer invisible
     lblCurrentTaskTime.Visible = false;
     btnStartStop.BackColor     = TimerStatus.GetColor();
 }