- Timestamp:
- 12/02/08 14:13:06 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactorBranch/HeuristicLab.Data/StringData.cs
r763 r885 55 55 Data = data; 56 56 } 57 58 /// <summary> 59 /// Copy constructor to create clones (deep). 60 /// </summary> 61 /// <param name="original">The original instance to be cloned.</param> 62 public StringData(StringData original) : this(original, new Dictionary<Guid, object>()) { } 63 /// <summary> 64 /// Copy constructor to create clones (deep) reusing already cloned object references. 65 /// </summary> 66 /// <param name="original">The instance to be cloned.</param> 67 /// <param name="clonedObjects">Already cloned objects (for referential integrity).</param> 68 protected StringData(StringData original, IDictionary<Guid, object> clonedObjects) 69 : base(original, clonedObjects) { 70 this.Data = original.Data; 71 } 57 72 58 73 /// <summary> … … 65 80 66 81 /// <summary> 67 /// Clones the current instance .82 /// Clones the current instance using the copy constructor. 68 83 /// </summary> 69 84 /// <remarks>The current instance is added to the dictionary <paramref name="clonedObjects"/>.</remarks> 70 /// <param name="clonedObjects">A dictionary of all already cloned objects .</param>85 /// <param name="clonedObjects">A dictionary of all already cloned objects (for referential integrity).</param> 71 86 /// <returns>The coned instance as <see cref="StringData"/>.</returns> 72 87 public override object Clone(IDictionary<Guid, object> clonedObjects) { 73 StringData clone = new StringData(); 74 clonedObjects.Add(Guid, clone); 75 clone.Data = Data; 76 return clone; 88 return new StringData(this, clonedObjects); 77 89 } 78 90
Note: See TracChangeset
for help on using the changeset viewer.