- Timestamp:
- 04/17/10 23:12:52 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Common/3.3/HeuristicLab.Common-3.3.csproj
r3384 r3385 89 89 <None Include="HeuristicLabCommonPlugin.cs.frame" /> 90 90 <Compile Include="Cloner.cs" /> 91 <Compile Include="DeepCloneable.cs" /> 91 92 <Compile Include="IContent.cs" /> 92 93 <Compile Include="IDeepCloneable.cs" /> -
trunk/sources/HeuristicLab.Core/3.3/ExecutionContext.cs
r3376 r3385 27 27 namespace HeuristicLab.Core { 28 28 [StorableClass] 29 public sealed class ExecutionContext : IDeepCloneable, IExecutionContext, IAtomicOperation {29 public sealed class ExecutionContext : DeepCloneable, IExecutionContext, IAtomicOperation { 30 30 [Storable] 31 31 private IParameterizedItem parameterizedItem; … … 63 63 } 64 64 65 public object Clone() { 66 return Clone(new Cloner()); 67 } 68 public IDeepCloneable Clone(Cloner cloner) { 65 public override IDeepCloneable Clone(Cloner cloner) { 69 66 ExecutionContext clone = new ExecutionContext(); 70 67 cloner.RegisterClonedObject(this, clone); -
trunk/sources/HeuristicLab.Core/3.3/Item.cs
r3376 r3385 31 31 [StorableClass] 32 32 [Item("Item", "Base class for all HeuristicLab items.")] 33 public abstract class Item : IDeepCloneable, IItem {33 public abstract class Item : DeepCloneable, IItem { 34 34 public virtual string ItemName { 35 35 get { return ItemAttribute.GetName(this.GetType()); } … … 61 61 protected Item(bool deserializing) { } 62 62 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 75 63 /// <summary> 76 64 /// Clones the current instance (deep clone). … … 78 66 /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param> 79 67 /// <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); 83 70 clone.readOnlyView = readOnlyView; 84 71 return clone; -
trunk/sources/HeuristicLab.Core/3.3/OperationCollection.cs
r3376 r3385 28 28 namespace HeuristicLab.Core { 29 29 [StorableClass] 30 public sealed class OperationCollection : IDeepCloneable, IList<IOperation>, IOperation {30 public sealed class OperationCollection : DeepCloneable, IList<IOperation>, IOperation { 31 31 [Storable] 32 32 private IList<IOperation> operations; … … 52 52 } 53 53 54 public object Clone() { 55 return Clone(new Cloner()); 56 } 57 public IDeepCloneable Clone(Cloner cloner) { 54 public override IDeepCloneable Clone(Cloner cloner) { 58 55 OperationCollection clone = (OperationCollection)Activator.CreateInstance(this.GetType()); 59 56 cloner.RegisterClonedObject(this, clone);
Note: See TracChangeset
for help on using the changeset viewer.