Changeset 4525 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/NumericRange.cs
- Timestamp:
- 09/27/10 17:38:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/NumericRange.cs
r4516 r4525 5 5 using HeuristicLab.Core; 6 6 using HeuristicLab.Data; 7 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 8 8 9 namespace HeuristicLab.Problems.MetaOptimization { 10 [StorableClass] 9 11 public class NumericRange : Item, INumericRange { 12 [Storable] 10 13 private IntValue lowerBound; 11 14 public IntValue LowerBound { … … 25 28 } 26 29 30 [Storable] 27 31 private IntValue upperBound; 28 32 public IntValue UpperBound { … … 42 46 } 43 47 48 [Storable] 44 49 private IntValue stepSize; 45 50 public IntValue StepSize { … … 63 68 UpperBound = new IntValue(0); 64 69 StepSize = new IntValue(1); 70 } 71 72 [StorableConstructor] 73 protected NumericRange(bool deserializing) : base(deserializing) { } 74 75 [StorableHook(HookType.AfterDeserialization)] 76 private void AfterDeserialization() { 77 if (lowerBound != null) { 78 lowerBound.ValueChanged += new EventHandler(lowerBound_ValueChanged); 79 } 80 if (upperBound != null) { 81 upperBound.ValueChanged += new EventHandler(upperBound_ValueChanged); 82 } 83 if (stepSize != null) { 84 stepSize.ValueChanged += new EventHandler(stepSize_ValueChanged); 85 } 65 86 } 66 87 … … 95 116 return string.Format("[{0},{1}:{2}]", LowerBound.ToString(), UpperBound.ToString(), StepSize.ToString()); 96 117 } 118 119 #region Cloning 120 public override Common.IDeepCloneable Clone(Common.Cloner cloner) { 121 NumericRange clone = (NumericRange)base.Clone(cloner); 122 clone.LowerBound = (IntValue)this.LowerBound.Clone(); 123 clone.UpperBound = (IntValue)this.UpperBound.Clone(); 124 clone.StepSize = (IntValue)this.StepSize.Clone(); 125 return base.Clone(cloner); 126 } 127 #endregion 97 128 } 98 129 }
Note: See TracChangeset
for help on using the changeset viewer.