Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/22/13 12:58:27 (11 years ago)
Author:
ascheibe
Message:

#1042 fixed OptimizerhiveTaskView

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.Views/3.3/HiveTasks/OptimizerHiveTaskView.cs

    r9894 r9895  
    3131  [Content(typeof(OptimizerHiveTask), true)]
    3232  public partial class OptimizerHiveTaskView : HiveTaskView {
    33     private Progress progress;
    34    
    3533    public new OptimizerHiveTask Content {
    3634      get { return (OptimizerHiveTask)base.Content; }
     
    4442    public OptimizerHiveTaskView() {
    4543      InitializeComponent();
    46       progress = new Progress();
    4744    }
    4845
     
    5653      }
    5754    }
     55
    5856    #region Content Events
    5957    protected override void RegisterContentEvents() {
    6058      base.RegisterContentEvents();
    6159      Content.IsControllableChanged += new EventHandler(Content_IsControllableChanged);
    62       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, progress);
     60      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, Content.Progress);
    6361    }
    6462
     
    7270      SetEnabledStateOfControls();
    7371    }
    74 
    7572    #endregion
    7673
     
    7976      var task = System.Threading.Tasks.Task.Factory.StartNew(ResumeTaskAsync);
    8077      task.ContinueWith((t) => {
    81         progress.Finish();
     78        Content.Progress.Finish();
    8279        ErrorHandling.ShowErrorDialog(this, "An error occured while resuming the task.", t.Exception);
    8380      }, TaskContinuationOptions.OnlyOnFaulted);
     
    8784      var task = System.Threading.Tasks.Task.Factory.StartNew(PauseTaskAsync);
    8885      task.ContinueWith((t) => {
    89         progress.Finish();
     86        Content.Progress.Finish();
    9087        ErrorHandling.ShowErrorDialog(this, "An error occured while pausing the task.", t.Exception);
    9188      }, TaskContinuationOptions.OnlyOnFaulted);
     
    9592      var task = System.Threading.Tasks.Task.Factory.StartNew(StopTaskAsync);
    9693      task.ContinueWith((t) => {
    97         progress.Finish();
     94        Content.Progress.Finish();
    9895        ErrorHandling.ShowErrorDialog(this, "An error occured while stopping the task.", t.Exception);
    9996      }, TaskContinuationOptions.OnlyOnFaulted);
     
    10299
    103100    private void PauseTaskAsync() {
    104       progress.Start("Pausing task. Please be patient for the command to take effect.");
     101      Content.Progress.Start("Pausing task. Please be patient for the command to take effect.");
    105102      Content.Pause();
    106       progress.Finish();
     103      Content.Progress.Finish();
    107104    }
    108105
    109106    private void StopTaskAsync() {
    110       progress.Start("Stopping task. Please be patient for the command to take effect.");
     107      Content.Progress.Start("Stopping task. Please be patient for the command to take effect.");
    111108      Content.Stop();
    112       progress.Finish();
     109      Content.Progress.Finish();
    113110    }
    114111
    115112    private void ResumeTaskAsync() {
    116       progress.Start("Resuming task. Please be patient for the command to take effect.");
     113      Content.Progress.Start("Resuming task. Please be patient for the command to take effect.");
    117114      Content.Restart();
    118       progress.Finish();
     115      Content.Progress.Finish();
    119116    }
    120117
Note: See TracChangeset for help on using the changeset viewer.