Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/02/12 16:39:06 (12 years ago)
Author:
abeham
Message:

#1762: Fixed progressView creation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBExperimentUploadView.cs

    r8165 r8181  
    5454    Algorithm selectedAlgorithm = null;
    5555    Problem selectedProblem = null;
    56     private ProgressView progressView; // this has to be disposed manually!
     56    private ProgressView progressView;
    5757    private Progress progress;
    5858
     
    223223      progress.Status = "Uploading runs to OKB...";
    224224      progress.ProgressValue = 0;
     225      progress.ProgressState = ProgressState.Started;
    225226      double count = dataGridView.Rows.Count;
    226227      int i = 0;
    227 
    228       using (var view = new ProgressView(this, progress)) {
    229         foreach (DataGridViewRow row in dataGridView.Rows) {
    230           selectedAlgorithm = algorithms.Where(x => x.Name == row.Cells[algorithmColumnIndex].Value.ToString()).FirstOrDefault();
    231           selectedProblem = problems.Where(x => x.Name == row.Cells[problemColumnIndex].Value.ToString()).FirstOrDefault();
    232           if (selectedAlgorithm == null || selectedProblem == null) {
    233             throw new ArgumentException("Can't retrieve the algorithm/problem to upload");
    234           }
    235 
    236           OKBRun run = new OKBRun(selectedAlgorithm.Id, selectedProblem.Id, row.Tag as IRun, UserInformation.Instance.User.Id);
    237           run.Store();
    238           i++;
    239           progress.ProgressValue = ((double)i) / count;
    240         }
     228      foreach (DataGridViewRow row in dataGridView.Rows) {
     229        selectedAlgorithm = algorithms.Where(x => x.Name == row.Cells[algorithmColumnIndex].Value.ToString()).FirstOrDefault();
     230        selectedProblem = problems.Where(x => x.Name == row.Cells[problemColumnIndex].Value.ToString()).FirstOrDefault();
     231        if (selectedAlgorithm == null || selectedProblem == null) {
     232          throw new ArgumentException("Can't retrieve the algorithm/problem to upload");
     233        }
     234
     235        OKBRun run = new OKBRun(selectedAlgorithm.Id, selectedProblem.Id, row.Tag as IRun, UserInformation.Instance.User.Id);
     236        run.Store();
     237        i++;
     238        progress.ProgressValue = ((double)i) / count;
    241239      }
    242240      ClearRuns();
Note: See TracChangeset for help on using the changeset viewer.