Free cookie consent management tool by TermsFeed Policy Generator

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

created a branch that uses XmlTextWriter instead of XMLDocument to save documents. Investigating ticket #103.

Location:
branches/XmlTextWriterBranch
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/XmlTextWriterBranch/HeuristicLab.Constraints/DoubleBoundedConstraint.cs

    r2 r119  
    132132
    133133    #region persistence
    134     public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
    135       XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    136       XmlAttribute lb = document.CreateAttribute("LowerBound");
    137       lb.Value = LowerBound+"";
    138       XmlAttribute lbi = document.CreateAttribute("LowerBoundIncluded");
    139       lbi.Value = lowerBoundIncluded+"";
    140       XmlAttribute lbe = document.CreateAttribute("LowerBoundEnabled");
    141       lbe.Value = lowerBoundEnabled + "";
    142       XmlAttribute ub = document.CreateAttribute("UpperBound");
    143       ub.Value = upperBound + "";
    144       XmlAttribute ubi = document.CreateAttribute("UpperBoundIncluded");
    145       ubi.Value = upperBoundIncluded + "";
    146       XmlAttribute ube = document.CreateAttribute("UpperBoundEnabled");
    147       ube.Value = upperBoundEnabled + "";
    148       node.Attributes.Append(lb);
    149       if (!lowerBoundIncluded) node.Attributes.Append(lbi);
    150       if (!lowerBoundEnabled) node.Attributes.Append(lbe);
    151       node.Attributes.Append(ub);
    152       if (!upperBoundIncluded) node.Attributes.Append(ubi);
    153       if (!upperBoundEnabled) node.Attributes.Append(ube);
    154       return node;
     134    //public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
     135    //  XmlNode node = base.GetXmlNode(name, document, persistedObjects);
     136    //  XmlAttribute lb = document.CreateAttribute("LowerBound");
     137    //  lb.Value = LowerBound+"";
     138    //  XmlAttribute lbi = document.CreateAttribute("LowerBoundIncluded");
     139    //  lbi.Value = lowerBoundIncluded+"";
     140    //  XmlAttribute lbe = document.CreateAttribute("LowerBoundEnabled");
     141    //  lbe.Value = lowerBoundEnabled + "";
     142    //  XmlAttribute ub = document.CreateAttribute("UpperBound");
     143    //  ub.Value = upperBound + "";
     144    //  XmlAttribute ubi = document.CreateAttribute("UpperBoundIncluded");
     145    //  ubi.Value = upperBoundIncluded + "";
     146    //  XmlAttribute ube = document.CreateAttribute("UpperBoundEnabled");
     147    //  ube.Value = upperBoundEnabled + "";
     148    //  node.Attributes.Append(lb);
     149    //  if (!lowerBoundIncluded) node.Attributes.Append(lbi);
     150    //  if (!lowerBoundEnabled) node.Attributes.Append(lbe);
     151    //  node.Attributes.Append(ub);
     152    //  if (!upperBoundIncluded) node.Attributes.Append(ubi);
     153    //  if (!upperBoundEnabled) node.Attributes.Append(ube);
     154    //  return node;
     155    //}
     156    public override void Persist(string name, XmlWriter writer, IDictionary<Guid, IStorable> persistedObjects) {
     157      base.Persist(name, writer, persistedObjects);
     158      writer.WriteAttributeString("LowerBound", LowerBound.ToString());
     159      if(!lowerBoundIncluded) writer.WriteAttributeString("LowerBoundIncluded", "false");
     160      if(!lowerBoundEnabled) writer.WriteAttributeString("LowerBoundEnabled", "false");
     161      writer.WriteAttributeString("UpperBound", UpperBound.ToString());
     162      if(!upperBoundIncluded) writer.WriteAttributeString("UpperBoundIncluded", "false");
     163      if(!upperBoundEnabled) writer.WriteAttributeString("UpperBoundEnabled", "false");
    155164    }
    156165
Note: See TracChangeset for help on using the changeset viewer.