Exemple #1
0
        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();
        }
Exemple #2
0
        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();
        }
Exemple #3
0
 public ProgressForm(ProgressControl pc)
 {
     _progressControl = pc;
     InitializeComponent();
 }
Exemple #4
0
 public ProgressForm(ProgressControl pc)
 {
     _progressControl = pc;
     InitializeComponent();
 }