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