public void ChangeProgress(I3ProgressingEventArgs e)
        {
            if (this.InvokeRequired)
            {
                try
                {
                    this.BeginInvoke(new MethodInvoker(delegate
                    {
                        ChangeProgress(e);
                    }));
                }
                catch
                {
                }
                return;
            }

            double positionD = Math.Abs(e.Max - e.Min) < 0.00001 ? 0 : e.Position / (e.Max - e.Min);

            positionD = positionD * 100;
            int position = (int)positionD;

            if (position != progressBar.Value || !string.Equals(progressBar.Tag.ToString(), e.Message))
            {
                progressBar.Minimum = 0;
                progressBar.Maximum = 100;
                progressBar.Value   = position;
                progressBar.Tag     = e.Message;
                Application.DoEvents();
            }
        }
Exemple #2
0
 public void ChangeProgress(I3ProgressingEventArgs e)
 {
     if (reporterForm != null && !reporterForm.IsDisposed)
     {
         reporterForm.Reporter.ChangeProgress(e);
     }
 }