Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/07/19 23:40:10 (5 years ago)
Author:
mkommend
Message:

#2520: Merged 16565 - 16579 into stable.

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Scripting/3.3/VariableStore.cs

    r15584 r17097  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2727using HeuristicLab.Common.Resources;
    2828using HeuristicLab.Core;
    29 using HeuristicLab.Persistence.Core;
    30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HEAL.Attic;
    3130using HeuristicLab.Persistence.Default.Xml;
    3231
    3332namespace HeuristicLab.Scripting {
    3433  [Item("VariableStore", "Represents a variable store.")]
    35   [StorableClass]
     34  [StorableType("DDE415E7-99FD-4C10-9B5E-63334876FFDE")]
    3635  public class VariableStore : ObservableDictionary<string, object>, IItem {
    3736    #region Properties
     
    5554    #region Constructors & Cloning
    5655    [StorableConstructor]
    57     protected VariableStore(bool deserializing) : base(deserializing) { }
     56    protected VariableStore(StorableConstructorFlag _) : base(_) { }
    5857    protected VariableStore(VariableStore original, Cloner cloner) {
    5958      cloner.RegisterClonedObject(original, this);
     
    8281    protected T CloneByPersistence<T>(T value) {
    8382      using (var serializerStream = new MemoryStream()) {
    84         XmlGenerator.Serialize(value, serializerStream);
     83        var serializer = new ProtoBufSerializer();
     84        serializer.Serialize(value, serializerStream, disposeStream: false);
    8585        var bytes = serializerStream.GetBuffer();
    8686        using (var deserializerStream = new MemoryStream(bytes)) {
    87           return XmlParser.Deserialize<T>(deserializerStream);
     87          return (T)serializer.Deserialize(deserializerStream);
    8888        }
    8989      }
Note: See TracChangeset for help on using the changeset viewer.