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.Hive.Views/3.3/HiveTasks/OptimizerHiveTaskView.cs

    r8165 r8181  
    3232  public partial class OptimizerHiveTaskView : HiveTaskView {
    3333    private Progress progress;
     34    private ProgressView progressView;
    3435
    3536    public new OptimizerHiveTask Content {
     
    6061      base.RegisterContentEvents();
    6162      Content.IsControllableChanged += new EventHandler(Content_IsControllableChanged);
     63      progressView = new ProgressView(this, progress);
    6264    }
    6365
    6466    protected override void DeregisterContentEvents() {
    6567      Content.IsControllableChanged -= new EventHandler(Content_IsControllableChanged);
     68      if (progressView != null) {
     69        progressView.Content = null;
     70        progressView.Dispose();
     71        progressView = null;
     72      }
    6673      base.DeregisterContentEvents();
    6774    }
     
    102109      progress.Status = "Pausing task. Please be patient for the command to take effect.";
    103110      progress.ProgressState = ProgressState.Started;
    104       using (var view = new ProgressView(this, progress)) {
    105         Content.Pause();
    106       }
     111      Content.Pause();
    107112    }
    108113
     
    110115      progress.Status = "Stopping task. Please be patient for the command to take effect.";
    111116      progress.ProgressState = ProgressState.Started;
    112       using (var view = new ProgressView(this, progress)) {
    113         Content.Stop();
    114       }
     117      Content.Stop();
    115118    }
    116119
     
    118121      progress.Status = "Resuming task. Please be patient for the command to take effect.";
    119122      progress.ProgressState = ProgressState.Started;
    120       using (var view = new ProgressView(this, progress)) {
    121         Content.Restart();
    122       }
     123      Content.Restart();
    123124    }
    124125
Note: See TracChangeset for help on using the changeset viewer.