Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/27/09 14:45:44 (15 years ago)
Author:
epitzer
Message:

Migrate HL.Data-3.3 to new persistence library. (#603)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data/3.3/IntData.cs

    r1529 r1669  
    7676      return clone;
    7777    }
    78 
    79     /// <summary>
    80     /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>.
    81     /// </summary>
    82     /// <remarks>The int value is saved as string in the node's inner text,
    83     /// formatted according to the local culture info and its number format.</remarks>
    84     /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param>
    85     /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param>
    86     /// <param name="persistedObjects">A dictionary of all already persisted objects.(Needed to avoid cycles.)</param>
    87     /// <returns>The saved <see cref="XmlNode"/>.</returns>
    88     public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) {
    89       XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    90       node.InnerText = Data.ToString(CultureInfo.InvariantCulture.NumberFormat);
    91       return node;
    92     }
    93     /// <summary>
    94     ///  Loads the persisted int value from the specified <paramref name="node"/>.
    95     /// </summary>
    96     /// <remarks>The int value must be saved in the node's inner text as a string and
    97     /// formatted according to the locale culture info and
    98     /// its number format (see <see cref="GetXmlNode"/>).</remarks>
    99     /// <param name="node">The <see cref="XmlNode"/> where the int is saved.</param>
    100     /// <param name="restoredObjects">A dictionary of all already restored objects. (Needed to avoid cycles.)</param>
    101     public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) {
    102       base.Populate(node, restoredObjects);
    103       Data = int.Parse(node.InnerText, CultureInfo.InvariantCulture.NumberFormat);
    104     }
    10578  }
    10679}
Note: See TracChangeset for help on using the changeset viewer.