Changeset 11204 for branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.Views/3.3/HiveTasks/OptimizerHiveTaskView.cs
- Timestamp:
- 07/18/14 13:34:37 (10 years ago)
- Location:
- branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.Views
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.Views
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/trunk/sources/HeuristicLab.Clients.Hive.Views merged eligible /branches/Algorithms.GradientDescent/HeuristicLab.Clients.Hive.Views 5516-5520 /branches/Benchmarking/sources/HeuristicLab.Clients.Hive.Views 6917-7005 /branches/CloningRefactoring/HeuristicLab.Clients.Hive.Views 4656-4721 /branches/DataAnalysis Refactoring/HeuristicLab.Clients.Hive.Views 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Clients.Hive.Views 5815-6180 /branches/DataAnalysis/HeuristicLab.Clients.Hive.Views 4458-4459,4462,4464 /branches/GP.Grammar.Editor/HeuristicLab.Clients.Hive.Views 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Clients.Hive.Views 5060 /branches/NET40/sources/HeuristicLab.Clients.Hive.Views 5138-5162 /branches/ParallelEngine/HeuristicLab.Clients.Hive.Views 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Clients.Hive.Views 7568-7810 /branches/QAPAlgorithms/HeuristicLab.Clients.Hive.Views 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Clients.Hive.Views 6828 /branches/RuntimeOptimizer/HeuristicLab.Clients.Hive.Views 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Views 7787-8333 /branches/SlaveShutdown/HeuristicLab.Clients.Hive.Views 8944-8956 /branches/SuccessProgressAnalysis/HeuristicLab.Clients.Hive.Views 5370-5682 /branches/Trunk/HeuristicLab.Clients.Hive.Views 6829-6865 /branches/UnloadJobs/HeuristicLab.Clients.Hive.Views 9168-9215 /branches/VNS/HeuristicLab.Clients.Hive.Views 5594-5752 /branches/histogram/HeuristicLab.Clients.Hive.Views 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.Views/3.3/HiveTasks/OptimizerHiveTaskView.cs
r11203 r11204 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 31 31 [Content(typeof(OptimizerHiveTask), true)] 32 32 public partial class OptimizerHiveTaskView : HiveTaskView { 33 private Progress progress;34 private ProgressView progressView;35 36 33 public new OptimizerHiveTask Content { 37 34 get { return (OptimizerHiveTask)base.Content; } … … 45 42 public OptimizerHiveTaskView() { 46 43 InitializeComponent(); 47 progress = new Progress() {48 CanBeCanceled = false,49 ProgressState = ProgressState.Finished50 };51 44 } 52 45 … … 60 53 } 61 54 } 55 62 56 #region Content Events 63 57 protected override void RegisterContentEvents() { 64 58 base.RegisterContentEvents(); 65 59 Content.IsControllableChanged += new EventHandler(Content_IsControllableChanged); 66 progressView = new ProgressView(this, progress);60 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, Content.Progress); 67 61 } 68 62 69 63 protected override void DeregisterContentEvents() { 70 64 Content.IsControllableChanged -= new EventHandler(Content_IsControllableChanged); 71 if (progressView != null) { 72 progressView.Content = null; 73 progressView.Dispose(); 74 progressView = null; 75 } 65 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this, false); 76 66 base.DeregisterContentEvents(); 77 67 } … … 80 70 SetEnabledStateOfControls(); 81 71 } 82 83 72 #endregion 84 73 … … 87 76 var task = System.Threading.Tasks.Task.Factory.StartNew(ResumeTaskAsync); 88 77 task.ContinueWith((t) => { 89 progress.Finish();78 Content.Progress.Finish(); 90 79 ErrorHandling.ShowErrorDialog(this, "An error occured while resuming the task.", t.Exception); 91 80 }, TaskContinuationOptions.OnlyOnFaulted); … … 95 84 var task = System.Threading.Tasks.Task.Factory.StartNew(PauseTaskAsync); 96 85 task.ContinueWith((t) => { 97 progress.Finish();86 Content.Progress.Finish(); 98 87 ErrorHandling.ShowErrorDialog(this, "An error occured while pausing the task.", t.Exception); 99 88 }, TaskContinuationOptions.OnlyOnFaulted); … … 103 92 var task = System.Threading.Tasks.Task.Factory.StartNew(StopTaskAsync); 104 93 task.ContinueWith((t) => { 105 progress.Finish();94 Content.Progress.Finish(); 106 95 ErrorHandling.ShowErrorDialog(this, "An error occured while stopping the task.", t.Exception); 107 96 }, TaskContinuationOptions.OnlyOnFaulted); … … 110 99 111 100 private void PauseTaskAsync() { 112 progress.Status = "Pausing task. Please be patient for the command to take effect."; 113 progress.ProgressState = ProgressState.Started; 101 Content.Progress.Start("Pausing task. Please be patient for the command to take effect."); 114 102 Content.Pause(); 115 progress.Finish();103 Content.Progress.Finish(); 116 104 } 117 105 118 106 private void StopTaskAsync() { 119 progress.Status = "Stopping task. Please be patient for the command to take effect."; 120 progress.ProgressState = ProgressState.Started; 107 Content.Progress.Start("Stopping task. Please be patient for the command to take effect."); 121 108 Content.Stop(); 122 progress.Finish();109 Content.Progress.Finish(); 123 110 } 124 111 125 112 private void ResumeTaskAsync() { 126 progress.Status = "Resuming task. Please be patient for the command to take effect."; 127 progress.ProgressState = ProgressState.Started; 113 Content.Progress.Start("Resuming task. Please be patient for the command to take effect."); 128 114 Content.Restart(); 129 progress.Finish();115 Content.Progress.Finish(); 130 116 } 131 117
Note: See TracChangeset
for help on using the changeset viewer.