- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CloningRefactoring (added) merged: 4656-4693,4696-4697,4711-4714,4718-4719
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/ArtificialAntProblem.cs
r4419 r4722 196 196 [StorableConstructor] 197 197 private ArtificialAntProblem(bool deserializing) : base(deserializing) { } 198 [StorableHook(HookType.AfterDeserialization)] 199 private void AfterDeserialization() { 200 // BackwardsCompatibility3.3 201 #region Backwards compatible code (remove with 3.4) 202 if (operators == null) InitializeOperators(); 203 #endregion 204 AttachEventHandlers(); 205 } 206 207 private ArtificialAntProblem(ArtificialAntProblem original, Cloner cloner) 208 : base(original, cloner) { 209 operators = original.operators.Select(x => cloner.Clone(x)).ToList(); 210 AttachEventHandlers(); 211 } 212 public override IDeepCloneable Clone(Cloner cloner) { 213 return new ArtificialAntProblem(this, cloner); 214 } 198 215 public ArtificialAntProblem() 199 216 : base() { … … 222 239 } 223 240 224 public override IDeepCloneable Clone(Cloner cloner) {225 ArtificialAntProblem clone = (ArtificialAntProblem)base.Clone(cloner);226 clone.operators = operators.Select(x => (IOperator)cloner.Clone(x)).ToList();227 clone.AttachEventHandlers();228 return clone;229 }230 231 241 #region Events 232 242 public event EventHandler SolutionCreatorChanged; … … 278 288 279 289 #region Helpers 280 [StorableHook(HookType.AfterDeserialization)]281 private void AfterDeserializationHook() {282 // BackwardsCompatibility3.3283 #region Backwards compatible code (remove with 3.4)284 if (operators == null) InitializeOperators();285 #endregion286 AttachEventHandlers();287 }288 289 290 private void AttachEventHandlers() { 290 291 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged);
Note: See TracChangeset
for help on using the changeset viewer.