- Timestamp:
- 04/14/08 21:51:15 (16 years ago)
- Location:
- branches/XmlTextReaderBranch
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/XmlTextReaderBranch/HeuristicLab.Data/DoubleData.cs
r2 r121 57 57 return node; 58 58 } 59 public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 60 base.Populate(node, restoredObjects); 59 //public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 60 // base.Populate(node, restoredObjects); 61 // double data; 62 // if(double.TryParse(node.InnerText, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out data) == true) { 63 // Data = data; 64 // } else { 65 // throw new FormatException("Can't parse " + node.InnerText + " as double value."); 66 // } 67 //} 68 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 69 base.Populate(reader, restoredObjects); 61 70 double data; 62 if(double.TryParse( node.InnerText, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out data) == true) {71 if(double.TryParse(reader.ReadString(), NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out data) == true) { 63 72 Data = data; 64 73 } else { 65 throw new FormatException("Can't parse " + node.InnerText + " as double value.");74 throw new FormatException("Can't parse " + reader.ReadString() + " as double value."); 66 75 } 67 76 }
Note: See TracChangeset
for help on using the changeset viewer.