Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/10 17:38:42 (13 years ago)
Author:
swagner
Message:

Finished cloning refactoring of HeuristicLab.Common, HeuristicLab.Collections and HeuristicLab.Core (#922)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CloningRefactoring/HeuristicLab.Core/3.3/Collections/ScopeList.cs

    r3431 r4668  
    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.