private void button1_Click(object sender, EventArgs e) { var pc = new ProgressControl(); var action = new Action<object>(delegate(object progressControl1) { var progressControl = (ProgressControl) progressControl1; for (int i = 1; i <= 50; i++) { if (progressControl.Cancel) break; smsService.Delete(i); } }); ThreadPool.QueueUserWorkItem(new WaitCallback(action), pc); var form = new ProgressForm(pc); form.ShowDialog(); }
private void button1_Click(object sender, EventArgs e) { var pc = new ProgressControl(); var action = new Action <object>(delegate(object progressControl1) { var progressControl = (ProgressControl)progressControl1; for (int i = 1; i <= 50; i++) { if (progressControl.Cancel) { break; } smsService.Delete(i); } }); ThreadPool.QueueUserWorkItem(new WaitCallback(action), pc); var form = new ProgressForm(pc); form.ShowDialog(); }
public ProgressForm(ProgressControl pc) { _progressControl = pc; InitializeComponent(); }
public ProgressForm(ProgressControl pc) { _progressControl = pc; InitializeComponent(); }