Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/04/17 19:53:35 (7 years ago)
Author:
gkronber
Message:

#2520 changed optimizer to use new persistence per default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceReintegration/HeuristicLab.Core.Views/3.3/Clipboard.cs

    r14927 r14930  
    3030using HeuristicLab.Common;
    3131using HeuristicLab.MainForm;
     32using HeuristicLab.Persistence;
    3233using HeuristicLab.Persistence.Default.Xml;
    3334using HeuristicLab.PluginInfrastructure;
     
    155156      foreach (string filename in items) {
    156157        try {
    157           T item = XmlParser.Deserialize<T>(filename);
     158
     159          #region backwards compatibility
     160          T item = null;
     161          try {
     162            item = XmlParser.Deserialize<T>(filename);
     163          } catch(Exception e) { }
     164          if (item == null)
     165            item = (T)(new ProtoBufSerializer()).Deserialize(filename);
     166          #endregion
    158167          OnItemLoaded(item, progressBar.Maximum / items.Length);
    159168        } catch (Exception) { }
     
    197206          i++;
    198207          SetEnabledStateOfContentViews(item, false);
    199           XmlGenerator.Serialize(item, ItemsPath + Path.DirectorySeparatorChar + i.ToString("00000000") + ".hl", CompressionLevel.Optimal);
     208          (new ProtoBufSerializer()).Serialize(item, ItemsPath + Path.DirectorySeparatorChar + i.ToString("00000000") + ".hl");
    200209          OnItemSaved(item, progressBar.Maximum / listView.Items.Count);
    201210        } catch (Exception) { } finally {
Note: See TracChangeset for help on using the changeset viewer.