Changeset 4668 for branches/CloningRefactoring/HeuristicLab.Core/3.3/Collections/ReadOnlyItemArray.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/ReadOnlyItemArray.cs
r4419 r4668 44 44 } 45 45 46 [StorableConstructor] 47 protected ReadOnlyItemArray(bool deserializing) : base(deserializing) { } 48 protected ReadOnlyItemArray(ReadOnlyItemArray<T> original, Cloner cloner) { 49 cloner.RegisterClonedObject(original, this); 50 array = cloner.Clone<IItemArray<T>>((IItemArray<T>)original.array); 51 RegisterEvents(); 52 } 46 53 public ReadOnlyItemArray() : base(new ItemArray<T>()) { } 47 54 public ReadOnlyItemArray(IItemArray<T> array) : base(array) { } 48 [StorableConstructor]49 protected ReadOnlyItemArray(bool deserializing) : base(deserializing) { }50 55 51 56 public object Clone() { … … 53 58 } 54 59 public virtual IDeepCloneable Clone(Cloner cloner) { 55 ReadOnlyItemArray<T> clone = (ReadOnlyItemArray<T>)Activator.CreateInstance(this.GetType()); 56 cloner.RegisterClonedObject(this, clone); 57 clone.array = (IItemArray<T>)((IItemArray<T>)array).Clone(cloner); 58 clone.RegisterEvents(); 59 return clone; 60 return new ReadOnlyItemArray<T>(this, cloner); 60 61 } 61 62
Note: See TracChangeset
for help on using the changeset viewer.