Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9895


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

#1042 fixed OptimizerhiveTaskView

Location:
trunk/sources
Files:
2 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
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveTasks/OptimizerHiveTask.cs

    r9456 r9895  
    2626using HeuristicLab.Collections;
    2727using HeuristicLab.Common;
     28using HeuristicLab.MainForm;
    2829using HeuristicLab.Optimization;
    2930using HeuristicLab.PluginInfrastructure;
     
    3132namespace HeuristicLab.Clients.Hive {
    3233  public class OptimizerHiveTask : HiveTask<OptimizerTask> {
     34    public Progress Progress { get; private set; }
     35
    3336    #region Constructors and Cloning
    34     public OptimizerHiveTask() { }
     37    public OptimizerHiveTask() {
     38      Progress = new Progress();
     39    }
    3540    public OptimizerHiveTask(IOptimizer optimizer)
    3641      : this() {
     
    4348    protected OptimizerHiveTask(OptimizerHiveTask original, Cloner cloner)
    4449      : base(original, cloner) {
     50      Progress = new Progress();
    4551    }
    4652    public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset for help on using the changeset viewer.