Changeset 4714 for branches/CloningRefactoring
- Timestamp:
- 11/03/10 03:08:05 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/MinAverageMaxValueAnalyzer.cs
r4677 r4714 89 89 private MinAverageMaxValueAnalyzer(MinAverageMaxValueAnalyzer original, Cloner cloner) 90 90 : base(original, cloner) { 91 resultsCollector = cloner.Clone(original.resultsCollector); 91 92 Initialize(); 92 93 } … … 149 150 ValueParameter.DepthChanged += new EventHandler(ValueParameter_DepthChanged); 150 151 CollectMinValueInResultsParameter.ValueChanged += new EventHandler(CollectMinValueInResultsParameter_ValueChanged); 151 CollectMinValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMinValueInResultsParameter_Value Changed);152 CollectMinValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMinValueInResultsParameter_Value_ValueChanged); 152 153 CollectMaxValueInResultsParameter.ValueChanged += new EventHandler(CollectMaxValueInResultsParameter_ValueChanged); 153 CollectMaxValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMaxValueInResultsParameter_Value Changed);154 CollectMaxValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMaxValueInResultsParameter_Value_ValueChanged); 154 155 CollectAverageValueInResultsParameter.ValueChanged += new EventHandler(CollectAverageValueInResultsParameter_ValueChanged); 155 CollectAverageValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectAverageValueInResultsParameter_Value Changed);156 CollectAverageValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectAverageValueInResultsParameter_Value_ValueChanged); 156 157 } 157 158 158 159 private void CollectAverageValueInResultsParameter_ValueChanged(object sender, EventArgs e) { 159 if (CollectAverageValueInResults.Value) 160 IParameter avgValueParameter; 161 resultsCollector.CollectedValues.TryGetValue("AverageValue", out avgValueParameter); 162 if (CollectAverageValueInResults.Value && avgValueParameter == null) 160 163 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("AverageValue", null, AverageValueParameter.Name)); 161 else { 162 IParameter avgValueParameter; 163 resultsCollector.CollectedValues.TryGetValue("AverageValue", out avgValueParameter); 164 else if (!CollectAverageValueInResults.Value && avgValueParameter != null) 164 165 resultsCollector.CollectedValues.Remove(avgValueParameter); 165 } 166 CollectAverageValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectAverageValueInResultsParameter_Value_ValueChanged); 167 } 168 169 private void CollectAverageValueInResultsParameter_Value_ValueChanged(object sender, EventArgs e) { 170 IParameter avgValueParameter; 171 resultsCollector.CollectedValues.TryGetValue("AverageValue", out avgValueParameter); 172 if (CollectAverageValueInResults.Value && avgValueParameter == null) 173 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("AverageValue", null, AverageValueParameter.Name)); 174 else if (!CollectAverageValueInResults.Value && avgValueParameter != null) 175 resultsCollector.CollectedValues.Remove(avgValueParameter); 166 176 } 167 177 168 178 private void CollectMaxValueInResultsParameter_ValueChanged(object sender, EventArgs e) { 169 if (CollectMaxValueInResults.Value) 179 IParameter maxValueParameter; 180 resultsCollector.CollectedValues.TryGetValue("MaxValue", out maxValueParameter); 181 if (CollectMaxValueInResults.Value && maxValueParameter == null) 170 182 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MaxValue", null, MaxValueParameter.Name)); 171 else { 172 IParameter maxValueParameter; 173 resultsCollector.CollectedValues.TryGetValue("MaxValue", out maxValueParameter); 183 else if (!CollectMaxValueInResults.Value && maxValueParameter != null) 184 resultsCollector.CollectedValues.Remove(maxValueParameter); 185 CollectMaxValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMaxValueInResultsParameter_Value_ValueChanged); 186 } 187 188 private void CollectMaxValueInResultsParameter_Value_ValueChanged(object sender, EventArgs e) { 189 IParameter maxValueParameter; 190 resultsCollector.CollectedValues.TryGetValue("MaxValue", out maxValueParameter); 191 if (CollectMaxValueInResults.Value && maxValueParameter == null) 192 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MaxValue", null, MaxValueParameter.Name)); 193 else if (!CollectMaxValueInResults.Value && maxValueParameter != null) 174 194 resultsCollector.CollectedValues.Remove(maxValueParameter); 175 195 } 176 }177 196 178 197 private void CollectMinValueInResultsParameter_ValueChanged(object sender, EventArgs e) { 179 if (CollectMinValueInResults.Value) 198 IParameter minValueParameter; 199 resultsCollector.CollectedValues.TryGetValue("MinValue", out minValueParameter); 200 if (CollectMinValueInResults.Value && minValueParameter == null) 180 201 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MinValue", null, MinValueParameter.Name)); 181 else { 182 IParameter minValueParameter; 183 resultsCollector.CollectedValues.TryGetValue("MinValue", out minValueParameter); 202 else if (!CollectMinValueInResults.Value && minValueParameter != null) 184 203 resultsCollector.CollectedValues.Remove(minValueParameter); 185 } 204 CollectMinValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMinValueInResultsParameter_Value_ValueChanged); 205 } 206 207 private void CollectMinValueInResultsParameter_Value_ValueChanged(object sender, EventArgs e) { 208 IParameter minValueParameter; 209 resultsCollector.CollectedValues.TryGetValue("MinValue", out minValueParameter); 210 if (CollectMinValueInResults.Value && minValueParameter == null) 211 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MinValue", null, MinValueParameter.Name)); 212 else if (!CollectMinValueInResults.Value && minValueParameter != null) 213 resultsCollector.CollectedValues.Remove(minValueParameter); 186 214 } 187 215
Note: See TracChangeset
for help on using the changeset viewer.