- Timestamp:
- 01/20/17 11:16:42 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceOverhaul/HeuristicLab.Core/3.3/PersistenceContentManager.cs
r12012 r14594 20 20 #endregion 21 21 22 using System; 22 23 using System.IO.Compression; 23 24 using HeuristicLab.Common; 25 using HeuristicLab.Persistence; 24 26 using HeuristicLab.Persistence.Default.Xml; 25 27 … … 29 31 30 32 protected override IStorableContent LoadContent(string filename) { 31 return XmlParser.Deserialize<IStorableContent>(filename); 33 try { 34 return XmlParser.Deserialize<IStorableContent>(filename); 35 } catch (Exception) { 36 var serializer = new ProtoBufSerializer(); 37 return (IStorableContent)serializer.Deserialize(filename); 38 } 32 39 } 33 40 34 41 protected override void SaveContent(IStorableContent content, string filename, bool compressed) { 35 XmlGenerator.Serialize(content, filename, compressed ? CompressionLevel.Optimal : CompressionLevel.NoCompression); 42 //XmlGenerator.Serialize(content, filename, compressed ? CompressionLevel.Optimal : CompressionLevel.NoCompression); 43 new ProtoBufSerializer().Serialize(content, filename); 36 44 } 37 45 }
Note: See TracChangeset
for help on using the changeset viewer.