示例#1
0
        private void bw1_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            this.progressBar1.Value = e.ProgressPercentage;
            string reportmsg = e.UserState as String;

            ResultBox1.AppendText(reportmsg + Environment.NewLine);
        }
示例#2
0
        private void Start1_Click(object sender, EventArgs e)
        {
            Start1.Enabled = false;
            totalErrors1   = 0;

            if (bw1.IsBusy != true)
            {
                bw1.RunWorkerAsync();
                ResultBox1.AppendText("Running..." + Environment.NewLine);
            }
        }
示例#3
0
        private void bw1_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                ResultBox1.AppendText("Errors occured. Please see log above." + Environment.NewLine);
                totalErrors1++;
            }
            else
            {
                if (e.Cancelled)
                {
                    ResultBox1.AppendText("Cancelled." + Environment.NewLine);
                    totalErrors1++;
                }
                else
                {
                    WorkResult result = e.Result as WorkResult;
                    ResultBox1.AppendText(result.ToString() + Environment.NewLine);
                    totalErrors1 += result.errors();
                }
            }

            Start1.Enabled = true;
        }