Changeset 11202 for branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.Views/3.3/HiveTasks/OptimizerHiveTaskView.cs
- Timestamp:
- 07/18/14 12:01:13 (10 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.Views/3.3/HiveTasks/OptimizerHiveTaskView.cs
r8939 r11202 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.