Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/23/09 16:43:34 (14 years ago)
Author:
swagner
Message:

Refactored cloning (#806)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data/3.3/ItemList_T.cs

    r2520 r2526  
    5252    /// <param name="clonedObjects">A dictionary of all already cloned objects.</param>
    5353    /// <returns>The cloned instance as <see cref="ItemList&lt;T&gt;"/>.</returns>
    54     public override object Clone(IDictionary<Guid, object> clonedObjects) {
     54    public override IItem Clone(ICloner cloner) {
    5555      ItemList<T> clone = new ItemList<T>();
    56       clonedObjects.Add(Guid, clone);
    57       CloneElements(clone, clonedObjects);
     56      cloner.RegisterClonedObject(this, clone);
     57      CloneElements(cloner, clone);
    5858      return clone;
    5959    }
     
    6666    /// <param name="destination">The <see cref="ItemList&lt;T&gt;"/> where to save the cloned objects.</param>
    6767    /// <param name="clonedObjects">A dictionary of all already cloned objects.</param>
    68     protected void CloneElements(ItemList<T> destination, IDictionary<Guid, object> clonedObjects) {
     68    protected void CloneElements(ICloner cloner, ItemList<T> destination) {
    6969      for (int i = 0; i < list.Count; i++)
    70         destination.list.Add((T) Auxiliary.Clone(list[i], clonedObjects));
     70        destination.list.Add((T)cloner.Clone(list[i]));
    7171    }
    7272
Note: See TracChangeset for help on using the changeset viewer.