Changeset 5419 for trunk/sources/HeuristicLab.Optimization.Views/3.3
- Timestamp:
- 02/04/11 01:29:43 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs
r5237 r5419 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using System.Windows.Forms; 25 26 using HeuristicLab.Common; … … 133 134 134 135 protected override void OnClosed(FormClosedEventArgs e) { 135 if ((Content != null) && (Content.ExecutionState == ExecutionState.Started)) Content.Stop(); 136 if ((Content != null) && (Content.ExecutionState == ExecutionState.Started)) { 137 //The content must be stopped if no other view showing the content is available 138 var optimizers = MainFormManager.MainForm.Views.OfType<IContentView>().Where(v => v != this).Select(v => v.Content).OfType<IOptimizer>(); 139 //add nested optimizers 140 optimizers = optimizers.SelectMany(opt => opt.NestedOptimizers).Union(optimizers); 141 142 if (!optimizers.Contains(Content)) Content.Stop(); 143 } 136 144 base.OnClosed(e); 137 145 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs
r5300 r5419 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Windows.Forms; 24 25 using HeuristicLab.Common; … … 109 110 110 111 protected override void OnClosed(FormClosedEventArgs e) { 111 if ((Content != null) && (Content.ExecutionState == ExecutionState.Started)) Content.Stop(); 112 if ((Content != null) && (Content.ExecutionState == ExecutionState.Started)) { 113 //The content must be stopped if no other view showing the content is available 114 var optimizers = MainFormManager.MainForm.Views.OfType<IContentView>().Where(v => v != this).Select(v => v.Content).OfType<IOptimizer>(); 115 //add nested optimizers 116 optimizers = optimizers.SelectMany(opt => opt.NestedOptimizers).Union(optimizers); 117 118 if (!optimizers.Contains(Content)) Content.Stop(); 119 } 112 120 base.OnClosed(e); 113 121 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentView.cs
r4540 r5419 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Windows.Forms; 24 25 using HeuristicLab.Common; … … 91 92 92 93 protected override void OnClosed(FormClosedEventArgs e) { 93 if ((Content != null) && (Content.ExecutionState == ExecutionState.Started)) Content.Stop(); 94 if ((Content != null) && (Content.ExecutionState == ExecutionState.Started)) { 95 //The content must be stopped if no other view showing the content is available 96 var optimizers = MainFormManager.MainForm.Views.OfType<IContentView>().Where(v => v != this).Select(v => v.Content).OfType<IOptimizer>(); 97 //add nested optimizers 98 optimizers = optimizers.SelectMany(opt => opt.NestedOptimizers).Union(optimizers); 99 100 if (!optimizers.Contains(Content)) Content.Stop(); 101 } 94 102 base.OnClosed(e); 95 103 }
Note: See TracChangeset
for help on using the changeset viewer.