예제 #1
0
 public void tick()
 {
     if (tickCount != EstimatedCompletionTime)
     {
         // will tick every 1.0 seconds and update "progress"
         if (tickCount < EstimatedCompletionTime)
         {
             double ticks           = (double)tickCount;
             double estCompletion   = (double)EstimatedCompletionTime;
             double thisWidth       = (double)this.Size.Width;
             double percentComplete = ticks / estCompletion;
             // calc size of progress rectablge based on % complete
             int rectWidth = (int)(thisWidth * percentComplete);
             rectProgress.Size = new Size(rectWidth, this.Size.Height);
             tickCount++;
             //myParentProgressBar.Refresh();
         }
         else
         {
             EstimatedProgressTimer.Stop();
             rectProgress.Size = this.Size;
             //myParentProgressBar.Refresh();
         }
     }
 }
예제 #2
0
 public void Finished()
 {
     EstimatedProgressTimer.Stop();
     tickCount            = EstimatedCompletionTime;
     rectProgress.Visible = true;
     rectProgress.Size    = this.Size;
     myParentProgressBar.Refresh();
     //Application.DoEvents();
 }
예제 #3
0
 public void pause()
 {
     EstimatedProgressTimer.Stop();
 }