- Timestamp:
- 07/23/20 14:18:19 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Parameters/3.3/ReferenceParameter.cs
r17594 r17694 110 110 } 111 111 112 // TODO: Remove 113 //protected void ChangeReference(IValueParameter newReference, bool retainData) { 114 // IItem oldValue = Value; 115 // var oldRef = ReferencedParameter; 116 // oldRef.ToStringChanged -= (o, e) => OnToStringChanged(); 117 // oldRef.ItemImageChanged -= (o, e) => OnItemImageChanged(); 118 // if (valueChanged != null) oldRef.ValueChanged -= OnReferencedParameterValueChanged; 119 // newReference.ToStringChanged += (o, e) => OnToStringChanged(); 120 // newReference.ItemImageChanged += (o, e) => OnItemImageChanged(); 121 // if (valueChanged != null) newReference.ValueChanged += OnReferencedParameterValueChanged; 122 // ReferencedParameter = newReference; 123 // oldRef.Value = (IItem)oldValue.Clone(); // This is problematic, e.g. FixedValueParameter !!! But necessary, otherwise the value holds reference to the old parameter 124 // if (retainData) Value = oldValue; 125 //} 126 112 127 113 128 #region event handlers … … 128 143 private void OnReferencedParameterValueChanged(object sender, EventArgs args) { 129 144 valueChanged?.Invoke(this, args); // note "this", not "sender" as sender would be the referenced parameter 145 OnItemImageChanged(); 146 OnToStringChanged(); 130 147 } 131 148 … … 166 183 return new ReferenceParameter<T>(this, cloner); 167 184 } 185 186 // TODO: Remove 187 //public void ChangeReference(IValueParameter<T> newParameter, bool retainData) { 188 // base.ChangeReference(newParameter, retainData); 189 //} 168 190 } 169 191 … … 193 215 return new ReferenceParameter<T, U>(this, cloner); 194 216 } 217 218 // TODO: Remove 219 //public void ChangeReference(IValueParameter<U> newParameter, bool retainData) { 220 // base.ChangeReference(newParameter, retainData); 221 //} 195 222 } 196 223 }
Note: See TracChangeset
for help on using the changeset viewer.