- Timestamp:
- 06/30/14 14:42:38 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Scripting/3.3/CSharpScript.cs
r11056 r11058 21 21 22 22 using System; 23 using System.IO;24 23 using System.Linq; 25 24 using System.Reflection; … … 27 26 using HeuristicLab.Common; 28 27 using HeuristicLab.Core; 29 using HeuristicLab.Persistence.Core;30 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.Persistence.Default.Xml;32 29 33 30 namespace HeuristicLab.Scripting { … … 81 78 protected CSharpScript(CSharpScript original, Cloner cloner) 82 79 : base(original, cloner) { 83 try { 84 using (var serializerStream = new MemoryStream()) { 85 XmlGenerator.Serialize(original.variableStore, serializerStream); 86 var bytes = serializerStream.GetBuffer(); 87 using (var deserializerStream = new MemoryStream(bytes)) { 88 variableStore = XmlParser.Deserialize<VariableStore>(deserializerStream); 89 } 90 } 91 } catch (PersistenceException pe) { 92 throw new NotSupportedException("Could not clone the script because some of its variables could not be cloned.", pe); 93 } 80 variableStore = cloner.Clone(original.variableStore); 94 81 } 95 82 public CSharpScript() {
Note: See TracChangeset
for help on using the changeset viewer.