- 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.Core/3.3/Collections/ReadOnlyItemDictionary.cs
r4419 r4722 47 47 } 48 48 49 [StorableConstructor] 50 protected ReadOnlyItemDictionary(bool deserializing) : base(deserializing) { } 51 protected ReadOnlyItemDictionary(ReadOnlyItemDictionary<TKey, TValue> original, Cloner cloner) { 52 cloner.RegisterClonedObject(original, this); 53 dict = cloner.Clone((IItemDictionary<TKey, TValue>)original.dict); 54 RegisterEvents(); 55 } 49 56 public ReadOnlyItemDictionary() : base(new ItemDictionary<TKey, TValue>()) { } 50 57 public ReadOnlyItemDictionary(IItemDictionary<TKey, TValue> dictionary) : base(dictionary) { } 51 [StorableConstructor]52 protected ReadOnlyItemDictionary(bool deserializing) : base(deserializing) { }53 58 54 59 public object Clone() { … … 56 61 } 57 62 public virtual IDeepCloneable Clone(Cloner cloner) { 58 ReadOnlyItemDictionary<TKey, TValue> clone = (ReadOnlyItemDictionary<TKey, TValue>)Activator.CreateInstance(this.GetType()); 59 cloner.RegisterClonedObject(this, clone); 60 clone.dict = (IItemDictionary<TKey, TValue>)((IItemDictionary<TKey, TValue>)dict).Clone(cloner); 61 clone.RegisterEvents(); 62 return clone; 63 return new ReadOnlyItemDictionary<TKey, TValue>(this, cloner); 63 64 } 64 65
Note: See TracChangeset
for help on using the changeset viewer.