Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/28/12 12:00:51 (12 years ago)
Author:
ascheibe
Message:

#1762 implemented review comments:

  • removed self disposing. The progress view now reacts if a progress is set and Finish() is now called on the progress object and not the view.
  • Moved Cancel event from ProgressView to Progress
  • throw ArgumentNullException if the parent view is null
Location:
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs

    r7928 r8145  
    4242    private ISet<TreeNode> filteredTreeNodes;
    4343    private ISet<TreeNode> nodeStore;
     44    private IProgress currentProgress;
    4445
    4546    private ISet<Resource> selectedResources;
     
    6869      imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.MonitorLarge);
    6970      imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.NetworkCenterLarge);
     71      progressView = new ProgressView(this);
    7072    }
    7173
     
    7476        Invoke(new Action(StartProgressView));
    7577      } else {
    76         if (progressView == null) {
    77           IProgress prog = new Progress();
    78           prog.Status = "Downloading resources. Please be patient.";
    79           progressView = new ProgressView(this, prog);
    80         }
     78        currentProgress = new Progress();
     79        currentProgress.Status = "Downloading resources. Please be patient.";
     80        progressView.Progress = currentProgress;
    8181      }
    8282    }
     
    8686        Invoke(new Action(FinishProgressView));
    8787      } else {
    88         if (progressView != null) {
    89           progressView.Finish();
    90           progressView = null;
    91           SetEnabledStateOfControls();
    92         }
     88        currentProgress.Finish();
     89        SetEnabledStateOfControls();
    9390      }
    9491    }
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r8109 r8145  
    5555    public RefreshableHiveJobView() {
    5656      InitializeComponent();
     57      progressView = new ProgressView(this);
    5758    }
    5859
     
    475476        Invoke(new Action(SetProgressView));
    476477      } else {
    477         if (progressView == null) {
    478           progressView = new ProgressView(this, Content.Progress);
    479         } else {
    480           progressView.Progress = Content.Progress;
    481         }
     478        progressView.Progress = Content.Progress;
    482479      }
    483480    }
     
    487484        Invoke(new Action<IProgress>(SetProgressView), progress);
    488485      } else {
    489         if (progressView == null) {
    490           progressView = new ProgressView(this, progress);
    491         } else {
    492           progressView.Progress = progress;
    493         }
     486        progressView.Progress = progress;
    494487      }
    495488    }
     
    499492        Invoke(new Action(FinishProgressView));
    500493      } else {
    501         if (progressView != null) {
    502           progressView.Finish();
    503           progressView = null;
    504           SetEnabledStateOfControls();
    505         }
     494        if (Content.Progress != null)
     495          Content.Progress.Finish();
     496        SetEnabledStateOfControls();
    506497      }
    507498    }
Note: See TracChangeset for help on using the changeset viewer.