Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/23/09 16:43:34 (15 years ago)
Author:
swagner
Message:

Refactored cloning (#806)

Location:
trunk/sources/HeuristicLab.Logging/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Logging/3.3/Linechart.cs

    r2520 r2526  
    8585    /// Clones the current instance (deep clone).
    8686    /// </summary>
    87     /// <remarks>Deep clone through <see cref="Auxiliary.Clone"/> method of helper class
     87    /// <remarks>Deep clone through <see cref="cloner.Clone"/> method of helper class
    8888    /// <see cref="Auxiliary"/>.</remarks>
    8989    /// <param name="clonedObjects">Dictionary of all already clone objects. (Needed to avoid cycles.)</param>
    9090    /// <returns>The cloned object as <see cref="Linechart"/>.</returns>
    91     public override object Clone(IDictionary<Guid, object> clonedObjects) {
    92       Linechart clone = (Linechart)base.Clone(clonedObjects);
    93       clone.myNumberOfLines = (IntData)Auxiliary.Clone(myNumberOfLines, clonedObjects);
    94       clone.myValues = (ItemList)Auxiliary.Clone(Values, clonedObjects);
     91    public override IItem Clone(ICloner cloner) {
     92      Linechart clone = (Linechart)base.Clone(cloner);
     93      clone.myNumberOfLines = (IntData)cloner.Clone(myNumberOfLines);
     94      clone.myValues = (ItemList)cloner.Clone(Values);
    9595      return clone;
    9696    }
  • trunk/sources/HeuristicLab.Logging/3.3/Log.cs

    r2520 r2526  
    5959    /// Clones the current instance (deep clone).
    6060    /// </summary>
    61     /// <remarks>Deep clone through <see cref="Auxiliary.Clone"/> method of helper class
     61    /// <remarks>Deep clone through <see cref="cloner.Clone"/> method of helper class
    6262    /// <see cref="Auxiliary"/>.</remarks>
    6363    /// <param name="clonedObjects">Dictionary of all already clone objects. (Needed to avoid cycles.)</param>
    6464    /// <returns>The cloned object as <see cref="Log"/>.</returns>
    65     public override object Clone(IDictionary<Guid, object> clonedObjects) {
    66       Log clone = (Log)base.Clone(clonedObjects);
    67       clone.myItems = (ItemList)Auxiliary.Clone(Items, clonedObjects);
     65    public override IItem Clone(ICloner cloner) {
     66      Log clone = (Log)base.Clone(cloner);
     67      clone.myItems = (ItemList)cloner.Clone(Items);
    6868      return clone;
    6969    }
  • trunk/sources/HeuristicLab.Logging/3.3/PointXYChart.cs

    r2520 r2526  
    8787    /// Clones the current instance (deep clone).
    8888    /// </summary>
    89     /// <remarks>Deep clone through <see cref="Auxiliary.Clone"/> method of helper class
     89    /// <remarks>Deep clone through <see cref="cloner.Clone"/> method of helper class
    9090    /// <see cref="Auxiliary"/>.</remarks>
    9191    /// <param name="clonedObjects">Dictionary of all already clone objects. (Needed to avoid cycles.)</param>
    9292    /// <returns>The cloned object as <see cref="PointXYChart"/>.</returns>
    93     public override object Clone(IDictionary<Guid, object> clonedObjects) {
    94       PointXYChart clone = (PointXYChart)base.Clone(clonedObjects);
    95       clone.myValues = (ItemList)Auxiliary.Clone(Values, clonedObjects);
     93    public override IItem Clone(ICloner cloner) {
     94      PointXYChart clone = (PointXYChart)base.Clone(cloner);
     95      clone.myValues = (ItemList)cloner.Clone(Values);
    9696      return clone;
    9797    }
Note: See TracChangeset for help on using the changeset viewer.