- Timestamp:
- 08/22/13 12:58:27 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive.Views/3.3/HiveTasks/OptimizerHiveTaskView.cs
r9894 r9895 31 31 [Content(typeof(OptimizerHiveTask), true)] 32 32 public partial class OptimizerHiveTaskView : HiveTaskView { 33 private Progress progress;34 35 33 public new OptimizerHiveTask Content { 36 34 get { return (OptimizerHiveTask)base.Content; } … … 44 42 public OptimizerHiveTaskView() { 45 43 InitializeComponent(); 46 progress = new Progress();47 44 } 48 45 … … 56 53 } 57 54 } 55 58 56 #region Content Events 59 57 protected override void RegisterContentEvents() { 60 58 base.RegisterContentEvents(); 61 59 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); 63 61 } 64 62 … … 72 70 SetEnabledStateOfControls(); 73 71 } 74 75 72 #endregion 76 73 … … 79 76 var task = System.Threading.Tasks.Task.Factory.StartNew(ResumeTaskAsync); 80 77 task.ContinueWith((t) => { 81 progress.Finish();78 Content.Progress.Finish(); 82 79 ErrorHandling.ShowErrorDialog(this, "An error occured while resuming the task.", t.Exception); 83 80 }, TaskContinuationOptions.OnlyOnFaulted); … … 87 84 var task = System.Threading.Tasks.Task.Factory.StartNew(PauseTaskAsync); 88 85 task.ContinueWith((t) => { 89 progress.Finish();86 Content.Progress.Finish(); 90 87 ErrorHandling.ShowErrorDialog(this, "An error occured while pausing the task.", t.Exception); 91 88 }, TaskContinuationOptions.OnlyOnFaulted); … … 95 92 var task = System.Threading.Tasks.Task.Factory.StartNew(StopTaskAsync); 96 93 task.ContinueWith((t) => { 97 progress.Finish();94 Content.Progress.Finish(); 98 95 ErrorHandling.ShowErrorDialog(this, "An error occured while stopping the task.", t.Exception); 99 96 }, TaskContinuationOptions.OnlyOnFaulted); … … 102 99 103 100 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."); 105 102 Content.Pause(); 106 progress.Finish();103 Content.Progress.Finish(); 107 104 } 108 105 109 106 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."); 111 108 Content.Stop(); 112 progress.Finish();109 Content.Progress.Finish(); 113 110 } 114 111 115 112 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."); 117 114 Content.Restart(); 118 progress.Finish();115 Content.Progress.Finish(); 119 116 } 120 117
Note: See TracChangeset
for help on using the changeset viewer.