Changeset 4722 for trunk/sources/HeuristicLab.Core/3.3/OperatorGraph.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.Core/3.3/OperatorGraph.cs
r4477 r4722 76 76 } 77 77 78 [StorableConstructor] 79 protected OperatorGraph(bool deserializing) : base(deserializing) { } 80 protected OperatorGraph(OperatorGraph original, Cloner cloner) 81 : base(original, cloner) { 82 operators = cloner.Clone(original.operators); 83 initialOperator = cloner.Clone(original.initialOperator); 84 visualizationInfo = cloner.Clone(original.visualizationInfo); 85 Initialize(); 86 } 78 87 /// <summary> 79 88 /// Initializes a new instance of <see cref="OperatorGraph"/>. … … 85 94 Initialize(); 86 95 } 87 [StorableConstructor]88 protected OperatorGraph(bool deserializing) : base(deserializing) { }89 96 90 97 //mkommend: IMPORTANT DO NOT REMOVE THIS PRIVATE EVENT … … 93 100 private void OnOperatorGraphDeserializationFinished() { 94 101 EventHandler handler = DeserializationFinished; 95 if (handler != null) 96 handler(this, EventArgs.Empty);97 } 102 if (handler != null) handler(this, EventArgs.Empty); 103 } 104 98 105 [StorableHook(HookType.AfterDeserialization)] 106 private void AfterDeserialization() { 107 Initialize(); 108 } 99 109 private void Initialize() { 100 110 RegisterOperatorsEvents(); … … 110 120 /// <returns>The cloned object as <see cref="OperatorGraph"/>.</returns> 111 121 public override IDeepCloneable Clone(Cloner cloner) { 112 OperatorGraph clone = (OperatorGraph)base.Clone(cloner); 113 clone.operators = (OperatorSet)cloner.Clone(operators); 114 clone.initialOperator = (IOperator)cloner.Clone(initialOperator); 115 clone.visualizationInfo = cloner.Clone(visualizationInfo); 116 clone.Initialize(); 117 return clone; 122 return new OperatorGraph(this, cloner); 118 123 } 119 124 … … 124 129 /// </summary> 125 130 protected virtual void OnInitialOperatorChanged() { 126 if (InitialOperatorChanged != null)127 InitialOperatorChanged(this, EventArgs.Empty);131 var handler = InitialOperatorChanged; 132 if (handler != null) handler(this, EventArgs.Empty); 128 133 } 129 134
Note: See TracChangeset
for help on using the changeset viewer.