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/OperationCollection.cs

    r3390 r4668  
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    2423using System.Linq;
     
    3938    }
    4039
     40    [StorableConstructor]
     41    private OperationCollection(bool deserializing) { }
     42    private OperationCollection(OperationCollection original, Cloner cloner)
     43      : base(original, cloner) {
     44      operations = new List<IOperation>(original.Select(x => cloner.Clone<IOperation>(x)));
     45      parallel = original.parallel;
     46    }
    4147    public OperationCollection() {
    4248      operations = new List<IOperation>();
     
    5157      parallel = false;
    5258    }
    53     [StorableConstructor]
    54     private OperationCollection(bool deserializing) { }
    5559
    5660    public override IDeepCloneable Clone(Cloner cloner) {
    57       OperationCollection clone = (OperationCollection)Activator.CreateInstance(this.GetType());
    58       cloner.RegisterClonedObject(this, clone);
    59       clone.operations = new List<IOperation>(this.Select(x => (IOperation)cloner.Clone(x)));
    60       clone.parallel = parallel;
    61       return clone;
     61      return new OperationCollection(this, cloner);
    6262    }
    6363
Note: See TracChangeset for help on using the changeset viewer.