Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/17/10 23:12:52 (12 years ago)
Author:
swagner
Message:

Added base class DeepCloneable again (#975)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/3.3/Item.cs

    r3376 r3385  
    3131  [StorableClass]
    3232  [Item("Item", "Base class for all HeuristicLab items.")]
    33   public abstract class Item : IDeepCloneable, IItem {
     33  public abstract class Item : DeepCloneable, IItem {
    3434    public virtual string ItemName {
    3535      get { return ItemAttribute.GetName(this.GetType()); }
     
    6161    protected Item(bool deserializing) { }
    6262
    63 
    64     /// <summary>
    65     /// Creates a deep clone of this instance.
    66     /// </summary>
    67     /// <remarks>
    68     /// This method is the entry point for creating a deep clone of a whole object graph.
    69     /// </remarks>
    70     /// <returns>A clone of this instance.</returns>
    71     public object Clone() {
    72       return Clone(new Cloner());
    73     }
    74 
    7563    /// <summary>
    7664    /// Clones the current instance (deep clone).
     
    7866    /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param>
    7967    /// <returns>The cloned object as <see cref="Variable"/>.</returns>
    80     public virtual IDeepCloneable Clone(Cloner cloner) {
    81       Item clone = (Item)Activator.CreateInstance(this.GetType());
    82       cloner.RegisterClonedObject(this, clone);
     68    public override IDeepCloneable Clone(Cloner cloner) {
     69      Item clone = (Item)base.Clone(cloner);
    8370      clone.readOnlyView = readOnlyView;
    8471      return clone;
Note: See TracChangeset for help on using the changeset viewer.