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.Optimization/3.3/RunCollectionConstraints/RunCollectionComparisonConstraint.cs

    r4157 r4722  
    3333    [StorableConstructor]
    3434    protected RunCollectionComparisonConstraint(bool deserializing) : base(deserializing) { }
     35
     36    protected RunCollectionComparisonConstraint(RunCollectionComparisonConstraint original, Cloner cloner)
     37      : base(original, cloner) {
     38      constraintColumn = original.constraintColumn;
     39    }
     40    public override IDeepCloneable Clone(Cloner cloner) {
     41      return new RunCollectionComparisonConstraint(this, cloner);
     42    }
    3543
    3644    public RunCollectionComparisonConstraint() : base() { }
     
    128136      return s;
    129137    }
    130 
    131     public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {
    132       RunCollectionComparisonConstraint clone = (RunCollectionComparisonConstraint)base.Clone(cloner);
    133 
    134       IItem constraintDataItem = this.ConstraintData as IItem;
    135       ICloneable constraintDataCloneable = this.ConstraintData as ICloneable;
    136       if (constraintDataItem != null)
    137         clone.ConstraintData = (IStringConvertibleValue)cloner.Clone(constraintDataItem);
    138       else if (constraintDataCloneable != null)
    139         clone.ConstraintData = (IStringConvertibleValue)constraintDataCloneable.Clone();
    140       else
    141         clone.ConstraintData = this.ConstraintData;
    142 
    143       clone.ConstraintOperation = this.ConstraintOperation;
    144       clone.constraintColumn = this.constraintColumn;
    145 
    146       return clone;
    147     }
    148138  }
    149139}
Note: See TracChangeset for help on using the changeset viewer.