Changeset 5307
- Timestamp:
- 01/17/11 11:42:42 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs
r5206 r5307 249 249 base.Problem_OperatorsChanged(sender, e); 250 250 } 251 void ElitesParameter_ValueChanging(object sender, EventArgs e) {252 Elites.ValueChanged -= new EventHandler(Elites_ValueChanged);253 }254 251 private void ElitesParameter_ValueChanged(object sender, EventArgs e) { 255 252 Elites.ValueChanged += new EventHandler(Elites_ValueChanged); … … 260 257 } 261 258 262 void PopulationSizeParameter_ValueChanging(object sender, EventArgs e) {263 PopulationSize.ValueChanged -= new EventHandler(PopulationSize_ValueChanged);264 }265 259 private void PopulationSizeParameter_ValueChanged(object sender, EventArgs e) { 266 260 PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged); … … 279 273 #region Helpers 280 274 private void Initialize() { 281 PopulationSizeParameter.ValueChanging += new EventHandler(PopulationSizeParameter_ValueChanging);282 275 PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged); 283 276 PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged); 284 ElitesParameter.ValueChanging += new EventHandler(ElitesParameter_ValueChanging);285 277 ElitesParameter.ValueChanged += new EventHandler(ElitesParameter_ValueChanged); 286 278 Elites.ValueChanged += new EventHandler(Elites_ValueChanged); -
trunk/sources/HeuristicLab.Core/3.3/Interfaces/IValueParameter.cs
r5206 r5307 26 26 IItem Value { get; set; } 27 27 bool GetsCollected { get; set; } 28 event EventHandler ValueChanging;29 28 event EventHandler ValueChanged; 30 29 event EventHandler GetsCollectedChanged; -
trunk/sources/HeuristicLab.Parameters/3.3/OptionalConstrainedValueParameter.cs
r5206 r5307 54 54 if (value != this.value) { 55 55 if ((value != null) && !validValues.Contains(value)) throw new ArgumentException("Invalid value."); 56 OnValueChanging();57 56 DeregisterValueEvents(); 58 57 this.value = value; … … 206 205 } 207 206 208 public event EventHandler ValueChanging;209 protected virtual void OnValueChanging() {210 EventHandler handler = ValueChanging;211 if (handler != null) handler(this, EventArgs.Empty);212 }213 207 public event EventHandler ValueChanged; 214 208 protected virtual void OnValueChanged() { -
trunk/sources/HeuristicLab.Parameters/3.3/ValueLookupParameter.cs
r5206 r5307 46 46 set { 47 47 if (value != this.value) { 48 OnValueChanging();49 48 DeregisterValueEvents(); 50 49 this.value = value; … … 160 159 } 161 160 162 public event EventHandler ValueChanging;163 protected virtual void OnValueChanging() {164 EventHandler handler = ValueChanging;165 if (handler != null) handler(this, EventArgs.Empty);166 }167 161 public event EventHandler ValueChanged; 168 162 protected virtual void OnValueChanged() {
Note: See TracChangeset
for help on using the changeset viewer.