Changeset 4722 for trunk/sources/HeuristicLab.Optimization/3.3/Run.cs
- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CloningRefactoring (added) merged: 4656-4693,4696-4697,4711-4714,4718-4719
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Optimization/3.3/Run.cs
r4419 r4722 38 38 [StorableConstructor] 39 39 private Run(bool deserializing) : base(deserializing) { } 40 private Run(Run original, Cloner cloner) 41 : base(original, cloner) { 42 color = original.color; 43 algorithm = cloner.Clone(original.algorithm); 44 45 parameters = new Dictionary<string, IItem>(); 46 foreach (string key in original.parameters.Keys) 47 parameters.Add(key, cloner.Clone(original.parameters[key])); 48 49 results = new Dictionary<string, IItem>(); 50 foreach (string key in original.results.Keys) 51 results.Add(key, cloner.Clone(original.results[key])); 52 } 53 public override IDeepCloneable Clone(Cloner cloner) { 54 return new Run(this, cloner); 55 } 56 40 57 public Run() 41 58 : base() { … … 81 98 } 82 99 [StorableHook(HookType.AfterDeserialization)] 83 private void AfterDeserialization Hook() {100 private void AfterDeserialization() { 84 101 if (color == Color.Empty) color = Color.Black; 85 102 } … … 128 145 handler(this, EventArgs.Empty); 129 146 } 130 131 public override IDeepCloneable Clone(Cloner cloner) {132 Run clone = (Run)base.Clone(cloner);133 clone.color = this.color;134 clone.algorithm = (IAlgorithm)cloner.Clone(algorithm);135 foreach (string key in parameters.Keys)136 clone.parameters.Add(key, (IItem)cloner.Clone(parameters[key]));137 foreach (string key in results.Keys)138 clone.results.Add(key, (IItem)cloner.Clone(results[key]));139 return clone;140 }141 147 } 142 148 }
Note: See TracChangeset
for help on using the changeset viewer.