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/ConstrainedIntData.cs

    r1529 r1669  
    4545    /// Initializes a new instance of <see cref="ConstrainedIntData"/> with default value <c>0</c>.
    4646    /// </summary>
    47     public ConstrainedIntData() : this (0) {
     47    public ConstrainedIntData()
     48      : this(0) {
    4849    }
    4950    /// <summary>
     
    5253    /// </summary>
    5354    /// <param name="data">The integer value to represent.</param>
    54     public ConstrainedIntData(int data) : base() {
     55    public ConstrainedIntData(int data)
     56      : base() {
    5557      base.Data = new IntData(data);
    5658    }
     
    8385      return clone;
    8486    }
    85 
    86     /// <summary>
    87     /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>.
    88     /// </summary>
    89     /// <remarks>Uses the <see cref="ConstrainedItemBase.GetXmlNode"/> implementation of base class
    90     /// <see cref="ConstrainedObjectData"/>. The int value is saved as a <see cref="IntData"/>
    91     /// in a child node having the tag name <c>Value</c>.</remarks>
    92     /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param>
    93     /// <param name="document">The <see cref="XmlDocument"/> where the data is saved.</param>
    94     /// <param name="persistedObjects">A dictionary of all already persisted objects. (Needed to avoid cycles.)</param>
    95     /// <returns>The saved <see cref="XmlNode"/>.</returns>
    96     public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) {
    97       XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    98       node.AppendChild(PersistenceManager.Persist("Value", ((IntData)base.Data), document, persistedObjects));
    99       return node;
    100     }
    101     /// <summary>
    102     /// Loads the persisted int value from the specified <paramref name="node"/>.
    103     /// </summary>
    104     /// <remarks>The int value must be saved in the child node as a persisted <see cref="IntData"/>
    105     /// having the tag name <c>Value</c> (see <see cref="GetXmlNode"/>).</remarks>
    106     /// <param name="node">The <see cref="XmlNode"/> where the int is saved.</param>
    107     /// <param name="restoredObjects">A dictionary of all already restored objects. (Needed to avoid cycles.)</param>
    108     public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) {
    109       base.Populate(node, restoredObjects);
    110       base.Data = (IntData)PersistenceManager.Restore(node.SelectSingleNode("Value"), restoredObjects);
    111     }
    11287  }
    11388}
Note: See TracChangeset for help on using the changeset viewer.