Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (14 years ago)
Author:
swagner
Message:

Merged cloning refactoring branch back into trunk (#922)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Core/3.3/Collections/ScopeList.cs

    r3431 r4722  
    2929  [Item("ScopeList", "Represents a list of scopes.")]
    3030  public sealed class ScopeList : ItemList<IScope> {
     31    [StorableConstructor]
     32    private ScopeList(bool deserializing) : base(deserializing) { }
     33    private ScopeList(ScopeList original, Cloner cloner)
     34      : base(original, cloner) {
     35      list = new List<IScope>(original.Select(x => cloner.Clone(x)));
     36    }
    3137    public ScopeList() : base() { }
    3238    public ScopeList(int capacity) : base(capacity) { }
    3339    public ScopeList(IEnumerable<IScope> collection) : base(collection) { }
    34     [StorableConstructor]
    35     private ScopeList(bool deserializing) : base(deserializing) { }
    3640
    3741    public override IDeepCloneable Clone(Cloner cloner) {
    38       ScopeList clone = new ScopeList();
    39       cloner.RegisterClonedObject(this, clone);
    40       clone.list = new List<IScope>(this.Select(x => (IScope)cloner.Clone(x)));
    41       return clone;
     42      return new ScopeList(this, cloner);
    4243    }
    4344  }
Note: See TracChangeset for help on using the changeset viewer.