Changeset 3317 for trunk/sources/HeuristicLab.Parameters
- Timestamp:
- 04/13/10 06:41:56 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Parameters/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Parameters/3.3/LookupParameter.cs
r3136 r3317 71 71 this.actualName = actualName == null ? string.Empty : actualName; 72 72 } 73 [StorableConstructor] 74 protected LookupParameter(bool deserializing) : base(deserializing) { } 73 75 74 76 public override IDeepCloneable Clone(Cloner cloner) { -
trunk/sources/HeuristicLab.Parameters/3.3/OptionalConstrainedValueParameter.cs
r3136 r3317 33 33 [StorableClass] 34 34 public class OptionalConstrainedValueParameter<T> : Parameter, IValueParameter<T> where T : class, IItem { 35 [Storable] 35 36 private ItemSet<T> validValues; 36 [Storable]37 37 public ItemSet<T> ValidValues { 38 38 get { return validValues; } 39 private set {40 DeregisterValidValuesEvents();41 validValues = value;42 RegisterValidValuesEvents();43 }44 39 } 45 40 41 [Storable] 46 42 private T value; 47 [Storable]48 43 public virtual T Value { 49 44 get { return this.value; } … … 74 69 public OptionalConstrainedValueParameter() 75 70 : base("Anonymous", typeof(T)) { 76 ValidValues = new ItemSet<T>(); 71 this.validValues = new ItemSet<T>(); 72 Initialize(); 77 73 } 78 74 public OptionalConstrainedValueParameter(string name) 79 75 : base(name, typeof(T)) { 80 ValidValues = new ItemSet<T>(); 76 this.validValues = new ItemSet<T>(); 77 Initialize(); 81 78 } 82 79 public OptionalConstrainedValueParameter(string name, ItemSet<T> validValues) 83 80 : base(name, typeof(T)) { 84 ValidValues = validValues; 81 this.validValues = validValues; 82 Initialize(); 85 83 } 86 84 public OptionalConstrainedValueParameter(string name, ItemSet<T> validValues, T value) 87 85 : base(name, typeof(T)) { 88 ValidValues = validValues; 89 Value = value; 86 this.validValues = validValues; 87 this.value = value; 88 Initialize(); 90 89 } 91 90 public OptionalConstrainedValueParameter(string name, string description) 92 91 : base(name, description, typeof(T)) { 93 ValidValues = new ItemSet<T>(); 92 this.validValues = new ItemSet<T>(); 93 Initialize(); 94 94 } 95 95 public OptionalConstrainedValueParameter(string name, string description, ItemSet<T> validValues) 96 96 : base(name, description, typeof(T)) { 97 ValidValues = validValues; 97 this.validValues = validValues; 98 Initialize(); 98 99 } 99 100 public OptionalConstrainedValueParameter(string name, string description, ItemSet<T> validValues, T value) 100 101 : base(name, description, typeof(T)) { 101 ValidValues = validValues; 102 Value = value; 102 this.validValues = validValues; 103 this.value = value; 104 Initialize(); 105 } 106 [StorableConstructor] 107 protected OptionalConstrainedValueParameter(bool deserializing) : base(deserializing) { } 108 109 [StorableHook(HookType.AfterDeserialization)] 110 private void Initialize() { 111 RegisterValidValuesEvents(); 112 if (value != null) value.ToStringChanged += new EventHandler(Value_ToStringChanged); 103 113 } 104 114 105 115 public override IDeepCloneable Clone(Cloner cloner) { 106 116 OptionalConstrainedValueParameter<T> clone = (OptionalConstrainedValueParameter<T>)base.Clone(cloner); 107 clone.ValidValues = (ItemSet<T>)cloner.Clone(validValues); 108 clone.Value = (T)cloner.Clone(value); 117 clone.validValues = (ItemSet<T>)cloner.Clone(validValues); 118 clone.value = (T)cloner.Clone(value); 119 clone.Initialize(); 109 120 return clone; 110 121 } -
trunk/sources/HeuristicLab.Parameters/3.3/OptionalValueParameter.cs
r3136 r3317 32 32 [StorableClass] 33 33 public class OptionalValueParameter<T> : Parameter, IValueParameter<T> where T : class, IItem { 34 [Storable] 34 35 private T value; 35 [Storable]36 36 public virtual T Value { 37 37 get { return this.value; } … … 66 66 public OptionalValueParameter(string name, T value) 67 67 : base(name, typeof(T)) { 68 Value = value; 68 this.value = value; 69 Initialize(); 69 70 } 70 71 public OptionalValueParameter(string name, string description) … … 73 74 public OptionalValueParameter(string name, string description, T value) 74 75 : base(name, description, typeof(T)) { 75 Value = value; 76 this.value = value; 77 Initialize(); 78 } 79 [StorableConstructor] 80 protected OptionalValueParameter(bool deserializing) : base(deserializing) { } 81 82 [StorableHook(HookType.AfterDeserialization)] 83 private void Initialize() { 84 if (value != null) value.ToStringChanged += new EventHandler(Value_ToStringChanged); 76 85 } 77 86 78 87 public override IDeepCloneable Clone(Cloner cloner) { 79 88 OptionalValueParameter<T> clone = (OptionalValueParameter<T>)base.Clone(cloner); 80 clone.Value = (T)cloner.Clone(value); 89 clone.value = (T)cloner.Clone(value); 90 clone.Initialize(); 81 91 return clone; 82 92 } -
trunk/sources/HeuristicLab.Parameters/3.3/Parameter.cs
r3136 r3317 91 91 this.dataType = dataType; 92 92 } 93 [StorableConstructor] 94 protected Parameter(bool deserializing) : base(deserializing) { } 93 95 94 96 public override IDeepCloneable Clone(Cloner cloner) { -
trunk/sources/HeuristicLab.Parameters/3.3/ValueLookupParameter.cs
r3080 r3317 32 32 [StorableClass] 33 33 public class ValueLookupParameter<T> : LookupParameter<T>, IValueLookupParameter<T> where T : class, IItem { 34 [Storable] 34 35 private T value; 35 [Storable]36 36 public T Value { 37 37 get { return this.value; } … … 66 66 public ValueLookupParameter(string name, T value) 67 67 : base(name) { 68 Value = value; 68 this.value = value; 69 Initialize(); 69 70 } 70 71 public ValueLookupParameter(string name, string description) … … 73 74 public ValueLookupParameter(string name, string description, T value) 74 75 : base(name, description) { 75 Value = value; 76 this.value = value; 77 Initialize(); 76 78 } 77 79 public ValueLookupParameter(string name, string description, string actualName) 78 80 : base(name, description, actualName) { 79 81 } 82 [StorableConstructor] 83 protected ValueLookupParameter(bool deserializing) : base(deserializing) { } 84 85 [StorableHook(HookType.AfterDeserialization)] 86 private void Initialize() { 87 if (value != null) value.ToStringChanged += new EventHandler(Value_ToStringChanged); 88 } 80 89 81 90 public override IDeepCloneable Clone(Cloner cloner) { 82 91 ValueLookupParameter<T> clone = (ValueLookupParameter<T>)base.Clone(cloner); 83 clone.Value = (T)cloner.Clone(value); 92 clone.value = (T)cloner.Clone(value); 93 clone.Initialize(); 84 94 return clone; 85 95 }
Note: See TracChangeset
for help on using the changeset viewer.