Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/28/12 18:49:22 (12 years ago)
Author:
ascheibe
Message:

#1762 Removed IProgressReporter and changed the Hive Job Manager accordingly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Views/ProgressView.cs

    r8145 r8156  
    3232      set {
    3333        if (progress == value) return;
    34         DeregisterProgressEvents();
     34        Finish();
    3535        progress = value;
    3636        RegisterProgressEvents();
     
    5050
    5151    private void ShowProgress() {
    52       this.Left = (parentView.ClientRectangle.Width / 2) - (this.Width / 2);
    53       this.Top = (parentView.ClientRectangle.Height / 2) - (this.Height / 2);
    54       this.Anchor = AnchorStyles.Left | AnchorStyles.Top;
     52      if (progress != null) {
     53        this.Left = (parentView.ClientRectangle.Width / 2) - (this.Width / 2);
     54        this.Top = (parentView.ClientRectangle.Height / 2) - (this.Height / 2);
     55        this.Anchor = AnchorStyles.Left | AnchorStyles.Top;
    5556
    56       LockBackground();
     57        LockBackground();
    5758
    58       if (!parentView.Controls.Contains(this)) {
    59         parentView.Controls.Add(this);
     59        if (!parentView.Controls.Contains(this)) {
     60          parentView.Controls.Add(this);
     61        }
     62
     63        BringToFront();
     64        Visible = true;
    6065      }
    61 
    62       BringToFront();
    63       Visible = true;
    6466    }
    6567
     
    123125      if (InvokeRequired) Invoke((Action)UpdateProgressValue);
    124126      else {
    125         double progressValue = progress.ProgressValue;
    126         if (progressValue < progressBar.Minimum || progressValue > progressBar.Maximum) {
    127           progressBar.Style = ProgressBarStyle.Marquee;
    128           progressBar.Value = progressBar.Minimum;
    129         } else {
    130           progressBar.Style = ProgressBarStyle.Blocks;
    131           progressBar.Value = (int)Math.Round(progressBar.Minimum + progressValue * (progressBar.Maximum - progressBar.Minimum));
     127        if (progress != null) {
     128          double progressValue = progress.ProgressValue;
     129          if (progressValue < progressBar.Minimum || progressValue > progressBar.Maximum) {
     130            progressBar.Style = ProgressBarStyle.Marquee;
     131            progressBar.Value = progressBar.Minimum;
     132          } else {
     133            progressBar.Style = ProgressBarStyle.Blocks;
     134            progressBar.Value = (int)Math.Round(progressBar.Minimum + progressValue * (progressBar.Maximum - progressBar.Minimum));
     135          }
    132136        }
    133137      }
     
    137141      if (InvokeRequired) Invoke((Action)UpdateProgressStatus);
    138142      else {
    139         string status = progress.Status;
    140         statusLabel.Text = progress.Status;
     143        if (progress != null) {
     144          string status = progress.Status;
     145          statusLabel.Text = progress.Status;
     146        }
    141147      }
    142148    }
Note: See TracChangeset for help on using the changeset viewer.