Changeset 1667 for trunk/sources/HeuristicLab.Core/3.3/OperatorLibrary.cs
- Timestamp:
- 04/27/09 14:18:39 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.3/OperatorLibrary.cs
r1529 r1667 24 24 using System.Text; 25 25 using System.Xml; 26 using HeuristicLab.Persistence.Default.Decomposers.Storable; 26 27 27 28 namespace HeuristicLab.Core { … … 30 31 /// </summary> 31 32 public class OperatorLibrary : ItemBase, IOperatorLibrary, IEditable { 33 34 [Storable] 32 35 private IOperatorGroup myGroup; 33 36 /// <summary> … … 73 76 return clone; 74 77 } 75 76 #region Persistence Methods77 /// <summary>78 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>.79 /// </summary>80 /// <remarks>Calls <see cref="StorableBase.GetXmlNode"/> of base class <see cref="ItemBase"/>.<br/>81 /// The operator group is saved as a child node with the tag name <c>OperatorGroup</c>.</remarks>82 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param>83 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param>84 /// <param name="persistedObjects">The dictionary of all already persisted objects.85 /// (Needed to avoid cycles.)</param>86 /// <returns>The saved <see cref="XmlNode"/>.</returns>87 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) {88 XmlNode node = base.GetXmlNode(name, document, persistedObjects);89 node.AppendChild(PersistenceManager.Persist("OperatorGroup", Group, document, persistedObjects));90 return node;91 }92 /// <summary>93 /// Loads the persisted operator library from the specified <paramref name="node"/>.94 /// </summary>95 /// <remarks>Calls <see cref="StorableBase.Populate"/> of base class <see cref="ItemBase"/>.<br/>96 /// See <see cref="GetXmlNode"/> for further information on how the data must be saved.</remarks>97 /// <param name="node">The <see cref="XmlNode"/> where the operator library is saved.</param>98 /// <param name="restoredObjects">The dictionary of all already restored objects.99 /// (Needed to avoid cycles.)</param>100 public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) {101 base.Populate(node, restoredObjects);102 myGroup = (IOperatorGroup)PersistenceManager.Restore(node.SelectSingleNode("OperatorGroup"), restoredObjects);103 }104 #endregion105 78 } 106 79 }
Note: See TracChangeset
for help on using the changeset viewer.