- Timestamp:
- 04/27/09 14:45:44 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data/3.3/ConstrainedIntData.cs
r1529 r1669 45 45 /// Initializes a new instance of <see cref="ConstrainedIntData"/> with default value <c>0</c>. 46 46 /// </summary> 47 public ConstrainedIntData() : this (0) { 47 public ConstrainedIntData() 48 : this(0) { 48 49 } 49 50 /// <summary> … … 52 53 /// </summary> 53 54 /// <param name="data">The integer value to represent.</param> 54 public ConstrainedIntData(int data) : base() { 55 public ConstrainedIntData(int data) 56 : base() { 55 57 base.Data = new IntData(data); 56 58 } … … 83 85 return clone; 84 86 } 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 class90 /// <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 }112 87 } 113 88 }
Note: See TracChangeset
for help on using the changeset viewer.