- Timestamp:
- 04/23/09 14:22:29 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DateTime2XmlFormatter.cs
r1623 r1625 14 14 15 15 public override DateTime Parse(XmlString x) { 16 return new DateTime(long.Parse(x.Data)); 16 try { 17 return new DateTime(long.Parse(x.Data)); 18 } catch (Exception e) { 19 throw new PersistenceException("Exception caugth while trying to reconstruct DateTime object.", e); 20 } 17 21 } 18 22 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DecimalNumber2XmlFormatterBase.cs
r1566 r1625 31 31 } 32 32 public override T Parse(XmlString x) { 33 return (T)ParseMethod.Invoke(null, new object[] { x.Data, CultureInfo.InvariantCulture }); 33 try { 34 return (T)ParseMethod.Invoke(null, new object[] { x.Data, CultureInfo.InvariantCulture }); 35 } catch (Exception e) { 36 throw new PersistenceException("Could not parse decimal number.", e); 37 } 34 38 } 35 39 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/SimpleNumber2XmlFormatterBase.cs
r1566 r1625 22 22 } 23 23 public override T Parse(XmlString x) { 24 return (T)ParseMethod.Invoke(null, new[] { x.Data }); 24 try { 25 return (T)ParseMethod.Invoke(null, new[] { x.Data }); 26 } catch (Exception e) { 27 throw new PersistenceException("Could not parse simple number.", e); 28 } 25 29 } 26 30 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/String2XmlFormatter.cs
r1623 r1625 26 26 sb.Append(m.Groups[1]); 27 27 } 28 string result = sb.ToString(); 29 if (result.Length == 0 && x.Data.Length > 0 && !x.Data.Equals("<![CDATA[]]>")) 30 throw new PersistenceException("Invalid CDATA section during string parsing."); 28 31 return sb.ToString(); 29 32 }
Note: See TracChangeset
for help on using the changeset viewer.