Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/20/09 15:06:46 (15 years ago)
Author:
epitzer
Message:

Upgrade Charting.Data, Logging, Operators.Programmable, OptimizationFrontend, OffspringSelection, SGA, TestFunctions and ThreadParallelEngine to 3.3 (#603)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Logging/3.3/Linechart.cs

    r1530 r1872  
    2626using HeuristicLab.Core;
    2727using HeuristicLab.Data;
     28using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2829
    2930namespace HeuristicLab.Logging {
     
    3233  /// </summary>
    3334  public class Linechart : ItemBase, IVisualizationItem {
     35    [Storable]
    3436    private IntData myNumberOfLines;
    3537    /// <summary>
     
    4648      }
    4749    }
     50    [Storable]
    4851    private ItemList myValues;
    4952    /// <summary>
     
    123126        ValuesChanged(this, new EventArgs());
    124127    }
    125 
    126     #region Persistence Methods
    127     /// <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 tag
    131     /// 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     #endregion
    156128  }
    157129}
Note: See TracChangeset for help on using the changeset viewer.