Changeset 1872 for trunk/sources/HeuristicLab.Logging/3.3/Linechart.cs
- Timestamp:
- 05/20/09 15:06:46 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Logging/3.3/Linechart.cs
r1530 r1872 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 29 29 30 namespace HeuristicLab.Logging { … … 32 33 /// </summary> 33 34 public class Linechart : ItemBase, IVisualizationItem { 35 [Storable] 34 36 private IntData myNumberOfLines; 35 37 /// <summary> … … 46 48 } 47 49 } 50 [Storable] 48 51 private ItemList myValues; 49 52 /// <summary> … … 123 126 ValuesChanged(this, new EventArgs()); 124 127 } 125 126 #region Persistence Methods127 /// <summary>128 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>.129 /// </summary>130 /// <remarks>The number of lines and the values are saved as child nodes with tag131 /// name <c>NumberOfLines</c> and <c>Values</c> respectively.</remarks>132 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param>133 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param>134 /// <param name="persistedObjects">The dictionary of all already persisted objects.135 /// (Needed to avoid cycles.)</param>136 /// <returns>The saved <see cref="XmlNode"/>.</returns>137 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {138 XmlNode node = base.GetXmlNode(name, document, persistedObjects);139 node.AppendChild(PersistenceManager.Persist("NumberOfLines", myNumberOfLines, document, persistedObjects));140 node.AppendChild(PersistenceManager.Persist("Values", Values, document, persistedObjects));141 return node;142 }143 /// <summary>144 /// Loads the persisted item from the specified <paramref name="node"/>.145 /// </summary>146 /// <remarks>Has to be saved in a special way, see <see cref="GetXmlNode"/> for further information.</remarks>147 /// <param name="node">The <see cref="XmlNode"/> where the Linechart is saved.</param>148 /// <param name="restoredObjects">The dictionary of all already restored objects.149 /// (Needed to avoid cycles.)</param>150 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {151 base.Populate(node, restoredObjects);152 myNumberOfLines = (IntData)PersistenceManager.Restore(node.SelectSingleNode("NumberOfLines"), restoredObjects);153 myValues = (ItemList)PersistenceManager.Restore(node.SelectSingleNode("Values"), restoredObjects);154 }155 #endregion156 128 } 157 129 }
Note: See TracChangeset
for help on using the changeset viewer.