public void slowMethod(DFeedBack dfeedback) { int count = 0; while (count != NUM_OF_STEPS) { Thread.Sleep(500); dfeedback(); count++; } }
private void btnGo_Click(object sender, EventArgs e) { if (rbProgressBar.Checked) dfeedback = new DFeedBack(updateProgressBar); if (rbSpinBox.Checked) dfeedback = new DFeedBack(updateSpinBox); if (rbTrackBar.Checked) dfeedback = new DFeedBack(updateTrackBar); slowMethod(dfeedback); }
private void btnGo_Click(object sender, EventArgs e) { if (rbProgressBar.Checked) { dfeedback = new DFeedBack(updateProgressBar); } if (rbSpinBox.Checked) { dfeedback = new DFeedBack(updateSpinBox); } if (rbTrackBar.Checked) { dfeedback = new DFeedBack(updateTrackBar); } slowMethod(dfeedback); }