Changeset 776 for trunk/sources/HeuristicLab.Core/OperatorGroup.cs
- Timestamp:
- 11/19/08 12:12:39 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/OperatorGroup.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Representation of a group of operators (can also include subgroups). 30 /// </summary> 28 31 public class OperatorGroup : StorableBase, IOperatorGroup { 29 32 private string myName; 33 /// <summary> 34 /// Gets or sets the name of the current operator group. 35 /// </summary> 36 /// <remarks>Calls <see cref="OnNameChanged"/> in the setter.</remarks> 30 37 public string Name { 31 38 get { return myName; } … … 38 45 } 39 46 private List<IOperatorGroup> mySubGroups; 47 /// <summary> 48 /// Gets all subgroups of the current instance. 49 /// <note type="caution"> The subgroups are returned read-only.</note> 50 /// </summary> 40 51 public ICollection<IOperatorGroup> SubGroups { 41 52 get { return mySubGroups.AsReadOnly(); } 42 53 } 43 54 private List<IOperator> myOperators; 55 /// <summary> 56 /// Gets all operators of the current instance. 57 /// <note type="caution"> The operators are returned read-only.</note> 58 /// </summary> 44 59 public ICollection<IOperator> Operators { 45 60 get { return myOperators.AsReadOnly(); } 46 61 } 47 62 63 /// <summary> 64 /// Initializes a new instance of <see cref="OperatorGroup"/> having "Anonymous" as name. 65 /// </summary> 48 66 public OperatorGroup() { 49 67 myName = "Anonymous"; … … 52 70 } 53 71 72 /// <summary> 73 /// Clones the current instance (deep clone). 74 /// </summary> 75 /// <remarks>Deep clone with <see cref="Auxiliary.Clone"/> method of helper class 76 /// <see cref="Auxiliary"/>.</remarks> 77 /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param> 78 /// <returns>The cloned object as <see cref="OperatorGroup"/>.</returns> 54 79 public override object Clone(IDictionary<Guid, object> clonedObjects) { 55 80 OperatorGroup clone = (OperatorGroup)base.Clone(clonedObjects); … … 62 87 } 63 88 89 /// <summary> 90 /// Adds the given subgroup (<paramref name="group"/>) to the current instance. 91 /// </summary> 92 /// <param name="group">The subgroup to add.</param> 64 93 public virtual void AddSubGroup(IOperatorGroup group) { 65 94 mySubGroups.Add(group); 66 95 } 96 /// <summary> 97 /// Removes the given subgroup (<paramref name="group"/>) from the current instance. 98 /// </summary> 99 /// <param name="group">The subgroup to remove.</param> 67 100 public virtual void RemoveSubGroup(IOperatorGroup group) { 68 101 mySubGroups.Remove(group); 69 102 } 103 /// <summary> 104 /// Ads the given operator <paramref name="op"/> to the current instance. 105 /// </summary> 106 /// <param name="op">The operator to add.</param> 70 107 public virtual void AddOperator(IOperator op) { 71 108 myOperators.Add(op); 72 109 } 110 /// <summary> 111 /// Removes the given operator <paramref name="op"/> from the current instance. 112 /// </summary> 113 /// <param name="op">The operator to remove.</param> 73 114 public virtual void RemoveOperator(IOperator op) { 74 115 myOperators.Remove(op); 75 116 } 76 117 118 /// <summary> 119 /// Occurs when the name of the operator was changed. 120 /// </summary> 77 121 public event EventHandler NameChanged; 122 /// <summary> 123 /// Fires a new <c>NameChanged</c> event. 124 /// </summary> 78 125 protected virtual void OnNameChanged() { 79 126 if (NameChanged != null) { … … 83 130 84 131 #region Persistence Methods 132 /// <summary> 133 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 134 /// </summary> 135 /// <remarks>Calls <see cref="StorableBase.GetXmlNode"/> of base class <see cref="ItemBase"/>.<br/> 136 /// A quick overview how the single elements of the current instance are saved: 137 /// <list type="bullet"> 138 /// <item> 139 /// <term>Name: </term> 140 /// <description>Saved as an <see cref="XmlAttribute"/> with attribute name <c>Name</c>.</description> 141 /// </item> 142 /// <item> 143 /// <term>Sub groups: </term> 144 /// <description>A child node is created with tag name <c>SubGroups</c>. Beyond this child node 145 /// all sub operator groups are saved as child nodes themselves.</description> 146 /// </item> 147 /// <item> 148 /// <term>Operators: </term> 149 /// <description>A child node is created with tag name <c>Operators</c>. Beyond this child node 150 /// all operators are saved as child nodes themselves.</description> 151 /// </item> 152 /// </list> 153 /// </remarks> 154 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 155 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 156 /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param> 157 /// <returns>The saved <see cref="XmlNode"/>.</returns> 85 158 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) { 86 159 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 98 171 return node; 99 172 } 173 /// <summary> 174 /// Loads the persisted operator group from the specified <paramref name="node"/>. 175 /// </summary> 176 /// <remarks>See <see cref="GetXmlNode"/> to get information about how the data must be saved. <br/> 177 /// Calls <see cref="StorableBase.Populate"/> of base class <see cref="StorableBase"/>.</remarks> 178 /// <param name="node">The <see cref="XmlNode"/> where the boolean value is saved.</param> 179 /// <param name="restoredObjects">The dictionary of all already restored objects. 180 /// (Needed to avoid cycles.)</param> 100 181 public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 101 182 base.Populate(node, restoredObjects);
Note: See TracChangeset
for help on using the changeset viewer.