Free cookie consent management tool by TermsFeed Policy Generator

Changeset 68


Ignore:
Timestamp:
03/14/08 23:28:53 (17 years ago)
Author:
swagner
Message:

Worked on ticket #58

  • added patch of pspitzli
Location:
trunk/sources/HeuristicLab.Data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data/ItemList.cs

    r64 r68  
    3232      ItemList clone = new ItemList();
    3333      clonedObjects.Add(Guid, clone);
    34       for (int i = 0; i < list.Count; i++)
    35         clone.list.Add((IItem)Auxiliary.Clone(list[i], clonedObjects));
     34      base.CloneElements(clone, clonedObjects);
    3635      return clone;
    3736    }
  • trunk/sources/HeuristicLab.Data/ItemList_T.cs

    r64 r68  
    2929namespace HeuristicLab.Data {
    3030  public class ItemList<T> : ItemBase, IList<T> where T : IItem {
    31     protected List<T> list;
     31    private List<T> list;
    3232
    3333    public ItemList() {
     
    4242      ItemList<T> clone = new ItemList<T>();
    4343      clonedObjects.Add(Guid, clone);
     44      CloneElements(clone, clonedObjects);
     45      return clone;
     46    }
     47    protected void CloneElements(ItemList<T> destination, IDictionary<Guid, object> clonedObjects) {
    4448      for (int i = 0; i < list.Count; i++)
    45         clone.list.Add((T) Auxiliary.Clone(list[i], clonedObjects));
    46       return clone;
     49        destination.list.Add((T)Auxiliary.Clone(list[i],clonedObjects));
    4750    }
    4851
Note: See TracChangeset for help on using the changeset viewer.