- Timestamp:
- 08/27/10 03:10:17 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Parameters/3.3/ValueLookupParameter.cs
r3822 r4332 66 66 } 67 67 68 [Storable(DefaultValue = true)] 69 private bool getsCollected; 70 public bool GetsCollected { 71 get { return getsCollected; } 72 set { 73 if (value != getsCollected) { 74 getsCollected = value; 75 OnGetsCollectedChanged(); 76 } 77 } 78 } 79 80 #region Constructors 68 81 public ValueLookupParameter() 69 82 : base() { 83 this.getsCollected = true; 70 84 } 71 85 public ValueLookupParameter(string name) 72 86 : base(name) { 87 this.getsCollected = true; 88 } 89 public ValueLookupParameter(string name, bool getsCollected) 90 : base(name) { 91 this.getsCollected = getsCollected; 73 92 } 74 93 public ValueLookupParameter(string name, T value) 75 94 : base(name) { 76 95 this.value = value; 96 this.getsCollected = true; 97 Initialize(); 98 } 99 public ValueLookupParameter(string name, T value, bool getsCollected) 100 : base(name) { 101 this.value = value; 102 this.getsCollected = getsCollected; 77 103 Initialize(); 78 104 } 79 105 public ValueLookupParameter(string name, string description) 80 106 : base(name, description) { 107 this.getsCollected = true; 108 } 109 public ValueLookupParameter(string name, string description, bool getsCollected) 110 : base(name, description) { 111 this.getsCollected = getsCollected; 81 112 } 82 113 public ValueLookupParameter(string name, string description, T value) 83 114 : base(name, description) { 84 115 this.value = value; 116 this.getsCollected = true; 117 Initialize(); 118 } 119 public ValueLookupParameter(string name, string description, T value, bool getsCollected) 120 : base(name, description) { 121 this.value = value; 122 this.getsCollected = getsCollected; 85 123 Initialize(); 86 124 } 87 125 public ValueLookupParameter(string name, string description, string actualName) 88 126 : base(name, description, actualName) { 127 this.getsCollected = true; 128 } 129 public ValueLookupParameter(string name, string description, string actualName, bool getsCollected) 130 : base(name, description, actualName) { 131 this.getsCollected = getsCollected; 89 132 } 90 133 [StorableConstructor] 91 134 protected ValueLookupParameter(bool deserializing) : base(deserializing) { } 135 #endregion 92 136 93 137 [StorableHook(HookType.AfterDeserialization)] … … 99 143 ValueLookupParameter<T> clone = (ValueLookupParameter<T>)base.Clone(cloner); 100 144 clone.value = (T)cloner.Clone(value); 145 clone.getsCollected = getsCollected; 101 146 clone.Initialize(); 102 147 return clone; … … 113 158 114 159 public event EventHandler ValueChanged; 115 pr ivatevoid OnValueChanged() {116 if (ValueChanged != null)117 ValueChanged(this, EventArgs.Empty);160 protected virtual void OnValueChanged() { 161 EventHandler handler = ValueChanged; 162 if (handler != null) handler(this, EventArgs.Empty); 118 163 OnItemImageChanged(); 119 164 OnToStringChanged(); 165 } 166 public event EventHandler GetsCollectedChanged; 167 protected virtual void OnGetsCollectedChanged() { 168 EventHandler handler = GetsCollectedChanged; 169 if (handler != null) handler(this, EventArgs.Empty); 120 170 } 121 171
Note: See TracChangeset
for help on using the changeset viewer.