/// <summary>
        /// This is the TimerTick event that stops the ProgressBar in each BMI level
        /// There are four levels os BMI
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ResultTimer_Tick(object sender, EventArgs e)
        {
            ResultProgressBar.Increment(1);
            switch (_bmiLevel)
            {
            case 1:
                if (ResultProgressBar.Value == 25)
                {
                    ResultTimer.Stop();
                }
                break;

            case 2:
                if (ResultProgressBar.Value == 50)
                {
                    ResultTimer.Stop();
                }
                break;

            case 3:
                if (ResultProgressBar.Value == 75)
                {
                    ResultTimer.Stop();
                }
                break;

            case 4:
                if (ResultProgressBar.Value == 100)
                {
                    ResultTimer.Stop();
                }
                break;
            }
        }
Ejemplo n.º 2
0
        private void buttonRun_Click(object sender, EventArgs e)
        {
            if (!Running)
            {
                if (!Worker.IsBusy)
                {
                    Worker.RunWorkerAsync();
                    buttonRun.Text = "Stop";
                    Running        = true;
                }

                ResultTimer.Interval = 20000;
                ResultTimer.Start();
            }
            else
            {
                if (Worker.IsBusy)
                {
                    Running = false;
                    Worker.CancelAsync();
                    buttonRun.Text = "Run";
                }

                ResultTimer.Stop();
            }
        }
Ejemplo n.º 3
0
 protected override void AppendToGrid(List <Artifact> Results, int nResIndex)
 {
     base.AppendToGrid(Results, nResIndex);
     if (!checkBoxSliceData.Checked && Results.Count > 0)
     {
         ResultTimer.Stop();
     }
 }
 /// <summary>
 /// This method clear fields and set Imperial unit
 /// </summary>
 private void ClearForm()
 {
     ImperialRadioButton.Checked = true;
     MetricRadioButton.Checked   = false;
     HeightUnitLabel.Text        = "Inches";
     WeightUnitLabel.Text        = "Pounds";
     HeightTextBox.Text          = string.Empty;
     WeightTextBox.Text          = string.Empty;
     ResultTextBox.Text          = string.Empty;
     ScaleTextBox.Text           = string.Empty;
     ScaleTextBox.BackColor      = Color.LightGray;
     ResultProgressBar.Value     = 0;
     ResultTimer.Stop();
 }
Ejemplo n.º 5
0
        void ResultTimer_Tick(object sender, EventArgs e)
        {
            if (!Worker.IsBusy && !ResultsWorker.IsBusy)
            {
                ResultTimer.Stop();
            }

            if (ResultTimerToStop)
            {
                ResultTimer.Stop();
            }

            if (!ResultsWorker.IsBusy)
            {
                ResultsWorker.RunWorkerAsync();
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 6
0
 private void ResultTimer_Tick(object sender, EventArgs e)
 {
     ResultTimer.Stop();
     ResetBoard();
 }
Ejemplo n.º 7
0
 public void StopTimer()
 {
     ResultTimer.Stop();
 }