Changeset 16911 for branches/2994-AutoDiffForIntervals/HeuristicLab.Core/3.3/PersistenceContentManager.cs
- Timestamp:
- 05/07/19 15:38:16 (5 years ago)
- Location:
- branches/2994-AutoDiffForIntervals
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2994-AutoDiffForIntervals
- Property svn:mergeinfo changed
-
branches/2994-AutoDiffForIntervals/HeuristicLab.Core
- Property svn:mergeinfo changed
/branches/2931_OR-Tools_LP_MIP/HeuristicLab.Core (added) merged: 16373 /trunk/HeuristicLab.Core (added) merged: 16872,16907,16910
- Property svn:mergeinfo changed
-
branches/2994-AutoDiffForIntervals/HeuristicLab.Core/3.3/PersistenceContentManager.cs
r16579 r16911 24 24 using HeuristicLab.Persistence.Default.Xml; 25 25 using HEAL.Attic; 26 using System;27 26 28 27 namespace HeuristicLab.Core { … … 32 31 protected override IStorableContent LoadContent(string filename) { 33 32 // first try to load using the new persistence format 34 try { 35 var ser = new ProtoBufSerializer(); 36 return (IStorableContent)ser.Deserialize(filename); 37 } catch (Exception) { 38 // try old format if new format fails 39 return XmlParser.Deserialize<IStorableContent>(filename); 33 var ser = new ProtoBufSerializer(); 34 var o = (IStorableContent)ser.Deserialize(filename, out SerializationInfo info); 35 if (info.SerializedTypes != null) { 36 return o; 40 37 } 38 // try old format if new format fails 39 return XmlParser.Deserialize<IStorableContent>(filename); 41 40 } 42 41 43 42 protected override void SaveContent(IStorableContent content, string filename, bool compressed, CancellationToken cancellationToken) { 44 43 var ser = new ProtoBufSerializer(); 45 ser.Serialize(content, filename, cancellationToken); 44 ser.Serialize(content, filename, cancellationToken); 46 45 } 47 46 }
Note: See TracChangeset
for help on using the changeset viewer.