- Timestamp:
- 11/25/14 03:26:00 (10 years ago)
- Location:
- branches/OptimizationNetworks
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks
- Property svn:mergeinfo changed
-
branches/OptimizationNetworks/HeuristicLab.Scripting/3.3/VariableStore.cs
r11058 r11576 45 45 dict[kvp.Key] = CloneByPersistence(kvp.Value); 46 46 } catch (PersistenceException pe) { 47 throw new NotSupportedException( "VariableStore: Variable " + kvp.Key + " could not be cloned.", pe);47 throw new NotSupportedException(string.Format(@"VariableStore: Variable ""{0}"" could not be cloned.", kvp.Key), pe); 48 48 } 49 49 } … … 59 59 } 60 60 61 protected object CloneByPersistence(objectvalue) {61 protected T CloneByPersistence<T>(T value) { 62 62 using (var serializerStream = new MemoryStream()) { 63 63 XmlGenerator.Serialize(value, serializerStream); 64 64 var bytes = serializerStream.GetBuffer(); 65 65 using (var deserializerStream = new MemoryStream(bytes)) { 66 return XmlParser.Deserialize< VariableStore>(deserializerStream);66 return XmlParser.Deserialize<T>(deserializerStream); 67 67 } 68 68 }
Note: See TracChangeset
for help on using the changeset viewer.