Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/15/08 16:41:18 (16 years ago)
Author:
gkronber
Message:

created a branch that combines the XmlReader and XmlWriter branches

Location:
branches/XmlReaderWriterBranch
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/XmlReaderWriterBranch/HeuristicLab.Random/MersenneTwister.cs

    r119 r125  
    148148      writer.WriteEndElement(); // </Init>
    149149    }
    150     public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
    151       base.Populate(node, restoredObjects);
    152 
    153       string stateString = node.SelectSingleNode("State").InnerText;
     150    //public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
     151    //  base.Populate(node, restoredObjects);
     152
     153    //  string stateString = node.SelectSingleNode("State").InnerText;
     154    //  string[] tokens = stateString.Split(';');
     155    //  for(int i = 0; i < tokens.Length; i++)
     156    //    state[i] = uint.Parse(tokens[i]);
     157    //  p = int.Parse(node.SelectSingleNode("P").InnerText);
     158    //  init = bool.Parse(node.SelectSingleNode("Init").InnerText);
     159    //}
     160    public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) {
     161      base.Populate(reader, restoredObjects);
     162      reader.Read();
     163      string stateString = reader.ReadElementString("State");
    154164      string[] tokens = stateString.Split(';');
    155165      for(int i = 0; i < tokens.Length; i++)
    156166        state[i] = uint.Parse(tokens[i]);
    157       p = int.Parse(node.SelectSingleNode("P").InnerText);
    158       init = bool.Parse(node.SelectSingleNode("Init").InnerText);
     167      p = int.Parse(reader.ReadElementString("P"));
     168      init = bool.Parse(reader.ReadElementString("Init"));
    159169    }
    160170    #endregion
Note: See TracChangeset for help on using the changeset viewer.