Changeset 16943 for branches/2994-AutoDiffForIntervals/HeuristicLab.Core/3.3/PersistenceContentManager.cs
- Timestamp:
- 05/11/19 08:14:56 (5 years ago)
- Location:
- branches/2994-AutoDiffForIntervals
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2994-AutoDiffForIntervals
- Property svn:mergeinfo changed
/trunk merged: 16933,16939-16940,16942
- Property svn:mergeinfo changed
-
branches/2994-AutoDiffForIntervals/HeuristicLab.Core
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Core merged: 16933,16942
- Property svn:mergeinfo changed
-
branches/2994-AutoDiffForIntervals/HeuristicLab.Core/3.3/PersistenceContentManager.cs
r16911 r16943 24 24 using HeuristicLab.Persistence.Default.Xml; 25 25 using HEAL.Attic; 26 using System; 26 27 27 28 namespace HeuristicLab.Core { … … 32 33 // first try to load using the new persistence format 33 34 var ser = new ProtoBufSerializer(); 34 var o = (IStorableContent)ser.Deserialize(filename, out SerializationInfo info); 35 if (info.SerializedTypes != null) { 36 return o; 35 try { 36 return (IStorableContent)ser.Deserialize(filename, out SerializationInfo info); 37 } catch (Exception e) { 38 try { 39 // try old format if new format fails 40 return XmlParser.Deserialize<IStorableContent>(filename); 41 } catch (Exception e2) { 42 throw new AggregateException($"Cannot open file {filename}", e, e2); 43 } 37 44 } 38 // try old format if new format fails39 return XmlParser.Deserialize<IStorableContent>(filename);40 45 } 41 46
Note: See TracChangeset
for help on using the changeset viewer.