Changeset 17097 for stable/HeuristicLab.Scripting/3.3/VariableStore.cs
- Timestamp:
- 07/07/19 23:40:10 (5 years ago)
- Location:
- stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
-
stable/HeuristicLab.Scripting/3.3/VariableStore.cs
r15584 r17097 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 27 27 using HeuristicLab.Common.Resources; 28 28 using HeuristicLab.Core; 29 using HeuristicLab.Persistence.Core; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HEAL.Attic; 31 30 using HeuristicLab.Persistence.Default.Xml; 32 31 33 32 namespace HeuristicLab.Scripting { 34 33 [Item("VariableStore", "Represents a variable store.")] 35 [Storable Class]34 [StorableType("DDE415E7-99FD-4C10-9B5E-63334876FFDE")] 36 35 public class VariableStore : ObservableDictionary<string, object>, IItem { 37 36 #region Properties … … 55 54 #region Constructors & Cloning 56 55 [StorableConstructor] 57 protected VariableStore( bool deserializing) : base(deserializing) { }56 protected VariableStore(StorableConstructorFlag _) : base(_) { } 58 57 protected VariableStore(VariableStore original, Cloner cloner) { 59 58 cloner.RegisterClonedObject(original, this); … … 82 81 protected T CloneByPersistence<T>(T value) { 83 82 using (var serializerStream = new MemoryStream()) { 84 XmlGenerator.Serialize(value, serializerStream); 83 var serializer = new ProtoBufSerializer(); 84 serializer.Serialize(value, serializerStream, disposeStream: false); 85 85 var bytes = serializerStream.GetBuffer(); 86 86 using (var deserializerStream = new MemoryStream(bytes)) { 87 return XmlParser.Deserialize<T>(deserializerStream);87 return (T)serializer.Deserialize(deserializerStream); 88 88 } 89 89 }
Note: See TracChangeset
for help on using the changeset viewer.