Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/27/09 16:16:21 (15 years ago)
Author:
epitzer
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators/3.3/VariableInjector.cs

    r1530 r1673  
    2525using System.Xml;
    2626using HeuristicLab.Core;
     27using HeuristicLab.Persistence.Default.Decomposers.Storable;
    2728
    2829namespace HeuristicLab.Operators {
     
    3132  /// </summary>
    3233  public class VariableInjector : OperatorBase {
     34
     35    [Storable]
    3336    private Dictionary<IVariable, IVariableInfo> variableVariableInfoTable;
     37
     38    [Storable]
    3439    private Dictionary<IVariableInfo, IVariable> variableInfoVariableTable;
    3540
     
    142147    }
    143148    #endregion
    144 
    145     #region Persistence Methods
    146     /// <summary>
    147     /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>.
    148     /// <note type="caution"> Variable infos are not persisted!</note>
    149     /// </summary>
    150     /// <remarks>Calls <see cref="OperatorBase.GetXmlNode"/> of base class <see cref="OperatorBase"/>.</remarks>
    151     /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param>
    152     /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param>
    153     /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param>
    154     /// <returns>The saved <see cref="XmlNode"/>.</returns>
    155     public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) {
    156       XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    157       // variable infos should not be persisted
    158       XmlNode infosNode = node.SelectSingleNode("VariableInfos");
    159       infosNode.RemoveAll();
    160       return node;
    161     }
    162     #endregion
    163149  }
    164150}
Note: See TracChangeset for help on using the changeset viewer.