Changeset 6197 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints
- Timestamp:
- 05/14/11 18:49:46 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/ConstrainedValue.cs
r5522 r6197 1 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 2 using HeuristicLab.Common; 5 3 using HeuristicLab.Core; 6 using HeuristicLab. Common;4 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 7 5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 using HeuristicLab.Data;9 6 10 7 namespace HeuristicLab.Problems.MetaOptimization { … … 56 53 private void RegisterEvents() { 57 54 this.value.ToStringChanged += new EventHandler(value_ToStringChanged); 55 if (this.value is Symbol) { 56 ((Symbol)this.value).Changed += new EventHandler(ConstrainedValue_Changed); 57 } 58 58 } 59 59 60 private void DeregisterEvents() { 60 61 this.value.ToStringChanged -= new EventHandler(value_ToStringChanged); 62 if (this.value is Symbol) { 63 ((Symbol)this.value).Changed -= new EventHandler(ConstrainedValue_Changed); 64 } 61 65 } 62 66 … … 90 94 } 91 95 96 private void ConstrainedValue_Changed(object sender, EventArgs e) { 97 OnToStringChanged(); 98 } 99 92 100 public override string ToString() { 101 if (this.value is Symbol) { 102 return string.Format("{0}: {1}", this.value, ((Symbol)this.value).InitialFrequency); 103 } 93 104 return value != null ? value.ToString() : base.ToString(); 94 105 }
Note: See TracChangeset
for help on using the changeset viewer.