Example #1
0
 public ProgressOperator()
 {
     this._backgroundWorker = new BackgroundWorker();
     this._processForm = new ProgressForm();
     this._eventArgs = new BackgroundWorkerEventArgs();
     this._backgroundWorker.DoWork += new DoWorkEventHandler(this.backgroundWorker_DoWork);
     this._backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.backgroundWorker_RunWorkerCompleted);
 }
Example #2
0
        private ProgressForm _processForm; //进度条窗体

        #endregion Fields

        #region Constructors

        public PercentProgressOperator()
        {
            this._processForm = new ProgressForm();
            this._eventArgs = new BackgroundWorkerEventArgs();
            this._processForm.ProcessStyle = System.Windows.Forms.ProgressBarStyle.Continuous;
            this._backgroundWorker = new BackgroundWorker();
            this._backgroundWorker.WorkerReportsProgress = true;
            this._backgroundWorker.DoWork += new DoWorkEventHandler(this._backgroundWorker_DoWork);
            this._backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this._backgroundWorker_RunWorkerCompleted);
            this._backgroundWorker.ProgressChanged += new ProgressChangedEventHandler(this._backgroundWorker_ProgressChanged);
        }
Example #3
0
 void process_BackgroundWorkerCompleted(object sender, BackgroundWorkerEventArgs e)
 {
     if (e.BackGroundException == null)
     {
         MessageBox.Show("执行完毕");
     }
     else
     {
         MessageBox.Show("异常:" + e.BackGroundException.Message);
     }
 }