Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (12 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.Optimization/3.3/Result.cs

    r4419 r4722  
    104104    [StorableConstructor]
    105105    private Result(bool deserializing) : base(deserializing) { }
     106    [StorableHook(HookType.AfterDeserialization)]
     107    private void AfterDeserialization() {
     108      Initialize();
     109    }
     110    private Result(Result original, Cloner cloner)
     111      : base(original, cloner) {
     112      value = cloner.Clone(original.value);
     113      Initialize();
     114    }
     115    public override IDeepCloneable Clone(Cloner cloner) {
     116      return new Result(this, cloner);
     117    }
    106118
    107     [StorableHook(HookType.AfterDeserialization)]
    108119    private void Initialize() {
    109120      RegisterValueEvents();
    110     }
    111 
    112     public override IDeepCloneable Clone(Cloner cloner) {
    113       Result clone = new Result(Name, Description, DataType);
    114       cloner.RegisterClonedObject(this, clone);
    115       clone.value = (IItem)cloner.Clone(value);
    116       clone.Initialize();
    117       return clone;
    118121    }
    119122
Note: See TracChangeset for help on using the changeset viewer.