- Timestamp:
- 02/07/15 13:52:48 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization/3.3/BasicProblems/BasicProblem.cs
r11949 r11970 86 86 private void RegisterEvents() { 87 87 EncodingParameter.ValueChanged += (o, e) => OnEncodingChanged(); 88 var multiEncoding = Encoding as MultiEncoding; 89 if (multiEncoding != null) multiEncoding.EncodingsChanged += MultiEncodingOnEncodingsChanged; 88 90 } 89 91 90 92 protected virtual void OnEncodingChanged() { 91 if (oldEncoding != null) AdaptEncodingOperators(oldEncoding, Encoding); 93 if (oldEncoding != null) { 94 AdaptEncodingOperators(oldEncoding, Encoding); 95 var oldMultiEncoding = oldEncoding as MultiEncoding; 96 if (oldMultiEncoding != null) 97 oldMultiEncoding.EncodingsChanged -= MultiEncodingOnEncodingsChanged; 98 } 92 99 oldEncoding = Encoding; 93 100 … … 104 111 //TODO register solution creator changed event, change access modifier to private 105 112 //((IValueParameter)solutionCreatorParam).ValueChanged += SolutionCreatorParameter_ValueChanged; 113 114 var multiEncoding = Encoding as MultiEncoding; 115 if (multiEncoding != null) multiEncoding.EncodingsChanged += MultiEncodingOnEncodingsChanged; 106 116 107 117 OnOperatorsChanged(); … … 141 151 } 142 152 153 protected virtual void MultiEncodingOnEncodingsChanged(object sender, EventArgs e) { 154 OnOperatorsChanged(); 155 } 143 156 } 144 157 }
Note: See TracChangeset
for help on using the changeset viewer.