- Timestamp:
- 11/06/10 01:56:04 (13 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.Core/3.3/Collections/ItemList.cs
r4419 r4722 46 46 } 47 47 48 [StorableConstructor] 49 protected ItemList(bool deserializing) : base(deserializing) { } 50 protected ItemList(ItemList<T> original, Cloner cloner) { 51 cloner.RegisterClonedObject(original, this); 52 list = new List<T>(original.Select(x => cloner.Clone(x))); 53 } 48 54 public ItemList() : base() { } 49 55 public ItemList(int capacity) : base(capacity) { } 50 56 public ItemList(IEnumerable<T> collection) : base(collection) { } 51 [StorableConstructor]52 protected ItemList(bool deserializing) : base(deserializing) { }53 57 54 58 public object Clone() { … … 56 60 } 57 61 public virtual IDeepCloneable Clone(Cloner cloner) { 58 ItemList<T> clone = (ItemList<T>)Activator.CreateInstance(this.GetType()); 59 cloner.RegisterClonedObject(this, clone); 60 clone.list = new List<T>(this.Select(x => (T)cloner.Clone(x))); 61 return clone; 62 return new ItemList<T>(this, cloner); 62 63 } 63 64
Note: See TracChangeset
for help on using the changeset viewer.