Changeset 4668 for branches/CloningRefactoring/HeuristicLab.Core/3.3/Collections/OperationCollection.cs
- Timestamp:
- 10/29/10 17:38:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Core/3.3/Collections/OperationCollection.cs
r3390 r4668 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 23 using System.Linq; … … 39 38 } 40 39 40 [StorableConstructor] 41 private OperationCollection(bool deserializing) { } 42 private OperationCollection(OperationCollection original, Cloner cloner) 43 : base(original, cloner) { 44 operations = new List<IOperation>(original.Select(x => cloner.Clone<IOperation>(x))); 45 parallel = original.parallel; 46 } 41 47 public OperationCollection() { 42 48 operations = new List<IOperation>(); … … 51 57 parallel = false; 52 58 } 53 [StorableConstructor]54 private OperationCollection(bool deserializing) { }55 59 56 60 public override IDeepCloneable Clone(Cloner cloner) { 57 OperationCollection clone = (OperationCollection)Activator.CreateInstance(this.GetType()); 58 cloner.RegisterClonedObject(this, clone); 59 clone.operations = new List<IOperation>(this.Select(x => (IOperation)cloner.Clone(x))); 60 clone.parallel = parallel; 61 return clone; 61 return new OperationCollection(this, cloner); 62 62 } 63 63
Note: See TracChangeset
for help on using the changeset viewer.