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