Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/15/08 14:17:26 (16 years ago)
Author:
gkronber
Message:

bug fixes to make loading of OSGA-TSP work. Some non-working code remains

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/XmlTextReaderBranch/HeuristicLab.Data/ConstrainedItemList.cs

    r121 r122  
    7777    public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) {
    7878      base.Populate(reader, restoredObjects);
    79       reader.ReadStartElement("ListItems");
     79      reader.Read();
     80      if(reader.Name!="ListItems") throw new XmlException("Expected: \"ListItems\", found: \""+reader.Name+"\"");
    8081      suspendConstraintCheck = bool.Parse(reader["SuspendConstraintCheck"]);
    8182      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      }
    8592    }
    8693    #endregion
Note: See TracChangeset for help on using the changeset viewer.