Changeset 4722 for trunk/sources/HeuristicLab.Operators.Programmable
- 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.Operators.Programmable/3.3/ProgrammableOperator.cs
r4477 r4722 160 160 161 161 #region Construction & Initialization 162 [StorableConstructor] 163 protected ProgrammableOperator(bool deserializing) : base(deserializing) { } 164 [StorableHook(HookType.AfterDeserialization)] 165 private void AfterDeserialization() { 166 RegisterEvents(); 167 } 168 169 protected ProgrammableOperator(ProgrammableOperator original, Cloner cloner) 170 : base(original, cloner) { 171 code = original.Code; 172 executeMethod = original.executeMethod; 173 Assemblies = original.Assemblies.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 174 namespaces = original.namespaces; 175 CompilationUnitCode = original.CompilationUnitCode; 176 CompileErrors = original.CompileErrors; 177 RegisterEvents(); 178 } 179 public override IDeepCloneable Clone(Cloner cloner) { 180 return new ProgrammableOperator(this, cloner); 181 } 162 182 163 183 public ProgrammableOperator() { … … 171 191 } 172 192 173 [StorableHook(HookType.AfterDeserialization)] 193 174 194 private void RegisterEvents() { 175 195 Parameters.ItemsAdded += Parameters_Changed; … … 185 205 protected void OnSignatureChanged() { 186 206 EventHandler handler = SignatureChanged; 187 if (handler != null) 188 handler(this, EventArgs.Empty); 207 if (handler != null) handler(this, EventArgs.Empty); 189 208 } 190 209 … … 426 445 public event EventHandler CodeChanged; 427 446 protected virtual void OnCodeChanged() { 428 if (CodeChanged != null)429 CodeChanged(this, new EventArgs());447 EventHandler handler = CodeChanged; 448 if (handler != null) handler(this, EventArgs.Empty); 430 449 } 431 450 432 451 #endregion 433 434 #region Cloning435 436 public override IDeepCloneable Clone(Cloner cloner) {437 ProgrammableOperator clone = (ProgrammableOperator)base.Clone(cloner);438 clone.code = Code;439 clone.executeMethod = executeMethod;440 clone.Assemblies = Assemblies.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);441 clone.namespaces = namespaces;442 clone.CompilationUnitCode = CompilationUnitCode;443 clone.CompileErrors = CompileErrors;444 clone.RegisterEvents();445 return clone;446 }447 448 #endregion449 450 452 } 451 453 }
Note: See TracChangeset
for help on using the changeset viewer.