Changeset 122 for branches/XmlTextReaderBranch/HeuristicLab.Data
- Timestamp:
- 04/15/08 14:17:26 (17 years ago)
- Location:
- branches/XmlTextReaderBranch/HeuristicLab.Data
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/XmlTextReaderBranch/HeuristicLab.Data/ConstrainedItemList.cs
r121 r122 77 77 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 78 78 base.Populate(reader, restoredObjects); 79 reader.ReadStartElement("ListItems"); 79 reader.Read(); 80 if(reader.Name!="ListItems") throw new XmlException("Expected: \"ListItems\", found: \""+reader.Name+"\""); 80 81 suspendConstraintCheck = bool.Parse(reader["SuspendConstraintCheck"]); 81 82 list = new List<IItem>(); 82 while(reader.IsStartElement()) 83 list.Add((IItem)PersistenceManager.Restore(reader, restoredObjects)); 84 reader.ReadEndElement(); 83 if(!reader.IsEmptyElement) { 84 while(reader.IsStartElement()) { 85 list.Add((IItem)PersistenceManager.Restore(reader, restoredObjects)); 86 reader.Skip(); 87 } 88 reader.ReadEndElement(); 89 } else { 90 reader.Read(); 91 } 85 92 } 86 93 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Data/DoubleData.cs
r121 r122 69 69 base.Populate(reader, restoredObjects); 70 70 double data; 71 if(double.TryParse(reader.ReadString(), NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out data) == true) { 71 string token = reader.ReadString(); 72 if(double.TryParse(token, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out data) == true) { 72 73 Data = data; 73 74 } else { 74 throw new FormatException("Can't parse " + reader.ReadString()+ " as double value.");75 throw new FormatException("Can't parse " + token + " as double value."); 75 76 } 76 77 } -
branches/XmlTextReaderBranch/HeuristicLab.Data/IntMatrixData.cs
r121 r122 74 74 int dim2 = int.Parse(reader["Dimension2"], CultureInfo.InvariantCulture.NumberFormat); 75 75 string[] tokens = reader.ReadString().Split(';'); 76 76 77 int[,] data = new int[dim1, dim2]; 77 78 for(int i = 0; i < dim1; i++) { -
branches/XmlTextReaderBranch/HeuristicLab.Data/ItemList_T.cs
r121 r122 63 63 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 64 64 base.Populate(reader, restoredObjects); 65 while(reader.IsStartElement()) 65 reader.Read(); 66 while(reader.IsStartElement()) { 66 67 list.Add((T)PersistenceManager.Restore(reader, restoredObjects)); 68 reader.Skip(); 69 } 70 reader.ReadEndElement(); 67 71 } 68 72
Note: See TracChangeset
for help on using the changeset viewer.