- Timestamp:
- 01/20/12 13:52:51 (13 years ago)
- Location:
- branches/HiveHiveEngine
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveHiveEngine
- Property svn:ignore
- Property svn:mergeinfo changed
/trunk/sources (added) merged: 7294-7295,7297,7304-7306,7318,7327,7333,7335,7341-7342,7351-7353,7369-7370
-
branches/HiveHiveEngine/HeuristicLab.Problems.ExternalEvaluation/3.3/ExternalEvaluationProblem.cs
r7259 r7383 127 127 [StorableConstructor] 128 128 private ExternalEvaluationProblem(bool deserializing) : base(deserializing) { } 129 [StorableHook(HookType.AfterDeserialization)]130 private void AfterDeserializationHook() {131 AttachEventHandlers();132 }133 134 129 private ExternalEvaluationProblem(ExternalEvaluationProblem original, Cloner cloner) 135 130 : base(original, cloner) { 136 AttachEventHandlers();131 RegisterEventHandlers(); 137 132 } 138 133 public override IDeepCloneable Clone(Cloner cloner) { … … 154 149 155 150 InitializeOperators(); 156 AttachEventHandlers();151 RegisterEventHandlers(); 157 152 } 158 153 [StorableHook(HookType.AfterDeserialization)] … … 170 165 } 171 166 #endregion 167 RegisterEventHandlers(); 172 168 } 173 169 … … 220 216 221 217 #region Helper 222 private void AttachEventHandlers() {218 private void RegisterEventHandlers() { 223 219 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 224 220 EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged); -
branches/HiveHiveEngine/HeuristicLab.Problems.ExternalEvaluation/3.3/SolutionMessageBuilder.cs
r7259 r7383 52 52 [StorableHook(HookType.AfterDeserialization)] 53 53 private void AfterDeserialization() { 54 AttachEventHandlers(); 54 // BackwardsCompatibility3.3 55 #region Backwards compatible code, remove with 3.4 56 #pragma warning disable 0612 57 if (converters != null) { 58 if (convertersList == null) convertersList = new CheckedItemList<IItemToSolutionMessageConverter>(); 59 foreach (IItemToSolutionMessageConverter c in converters) 60 convertersList.Add(c); 61 converters.Clear(); 62 converters = null; 63 } 64 #pragma warning restore 0612 65 #endregion 66 RegisterEventHandlers(); 55 67 } 56 68 … … 58 70 : base(original, cloner) { 59 71 convertersList = cloner.Clone(original.convertersList); 60 AttachEventHandlers();72 RegisterEventHandlers(); 61 73 } 62 74 public override IDeepCloneable Clone(Cloner cloner) { … … 75 87 convertersList.Add(new TimeSpanValueConverter()); 76 88 77 AttachEventHandlers();89 RegisterEventHandlers(); 78 90 } 79 91 … … 93 105 } 94 106 95 private void AttachEventHandlers() { 96 // BackwardsCompatibility3.3 97 #region Backwards compatible code, remove with 3.4 98 #pragma warning disable 0612 99 if (converters != null) { 100 if (convertersList == null) convertersList = new CheckedItemList<IItemToSolutionMessageConverter>(); 101 foreach (IItemToSolutionMessageConverter c in converters) 102 convertersList.Add(c); 103 converters.Clear(); 104 converters = null; 105 } 106 #pragma warning restore 0612 107 #endregion 107 private void RegisterEventHandlers() { 108 108 convertersList.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IItemToSolutionMessageConverter>>(convertersList_Changed); 109 109 convertersList.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IItemToSolutionMessageConverter>>(convertersList_Changed);
Note: See TracChangeset
for help on using the changeset viewer.