Changeset 776
- Timestamp:
- 11/19/08 12:12:39 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 70 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/AliasEventArgs.cs
r61 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Event arguments to be able to specify the affected alias. 29 /// </summary> 27 30 public class AliasEventArgs : EventArgs { 28 31 private string myAlias; 32 /// <summary> 33 /// Gets the affected alias. 34 /// </summary> 29 35 public string Alias { 30 36 get { return myAlias; } 31 37 } 32 38 39 /// <summary> 40 /// Initializes a new instance of <see cref="AliasEventArgs"/> with the given <paramref name="alias"/>. 41 /// </summary> 42 /// <param name="alias">The affected alias.</param> 33 43 public AliasEventArgs(string alias) { 34 44 myAlias = alias; -
trunk/sources/HeuristicLab.Core/AtomicOperation.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Represents a single operation with one operator and one scope. 30 /// </summary> 28 31 public class AtomicOperation : ItemBase, IOperation { 29 32 private IOperator myOperator; 33 /// <summary> 34 /// Gets the current operator as <see cref="IOperator"/>. 35 /// </summary> 30 36 public IOperator Operator { 31 37 get { return myOperator; } 32 38 } 33 private IScope myScope; 39 private IScope myScope; 40 /// <summary> 41 /// Gets the current scope as <see cref="IScope"/>. 42 /// </summary> 34 43 public IScope Scope { 35 44 get { return myScope; } 36 45 } 37 46 47 /// <summary> 48 /// Initializes a new instance of <see cref="AtomicOperation"/>. 49 /// </summary> 38 50 public AtomicOperation() { } 51 /// <summary> 52 /// Initializes a new instance of <see cref="AtomicOperation"/> with the given <paramref name="op"/> 53 /// and the given <paramref name="scope"/>. 54 /// </summary> 55 /// <param name="op">The operator to assign.</param> 56 /// <param name="scope">The scope to assign.</param> 39 57 public AtomicOperation(IOperator op, IScope scope) { 40 58 myOperator = op; … … 42 60 } 43 61 62 /// <summary> 63 /// Clones the current instance. 64 /// </summary> 65 /// <remarks>The operator and the scope objects are cloned with the 66 /// <see cref="HeuristicLab.Core.Auxiliary.Clone"/> method of the <see cref="Auxiliary"/> class.</remarks> 67 /// <param name="clonedObjects">All already cloned objects. (Needed to avoid cycles.)</param> 68 /// <returns>The cloned object as <see cref="AtomicOperation"/>.</returns> 44 69 public override object Clone(IDictionary<Guid, object> clonedObjects) { 45 70 AtomicOperation clone = new AtomicOperation(); … … 51 76 52 77 #region Persistence Methods 78 79 /// <summary> 80 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 81 /// </summary> 82 /// <remarks>Calls <see cref="HeuristicLab.Core.StorableBase.GetXmlNode"/> of base 83 /// class <see cref="ItemBase"/>. <br/> 84 /// The operator is saved as child node having the tag name <c>Operator</c>.<br/> 85 /// The scope is also saved as a child node having the tag name <c>Scope</c>.</remarks> 86 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 87 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 88 /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param> 89 /// <returns>The saved <see cref="XmlNode"/>.</returns> 53 90 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 54 91 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 57 94 return node; 58 95 } 96 /// <summary> 97 /// Loads the persisted operation from the specified <paramref name="node"/>. 98 /// </summary> 99 /// <remarks>Calls <see cref="HeuristicLab.Core.StorableBase.Populate"/> of base class 100 /// <see cref="ItemBase"/>.<br/> 101 /// The operator must be saved as a child node with the tag name <c>Operator</c>, also the scope must 102 /// be saved as a child node having the tag name <c>Scope</c> (see <see cref="GetXmlNode"/>).</remarks> 103 /// <param name="node">The <see cref="XmlNode"/> where the operation is saved.</param> 104 /// <param name="restoredObjects">A dictionary of all already restored objects. (Needed to avoid cycles.)</param> 59 105 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 60 106 base.Populate(node, restoredObjects); -
trunk/sources/HeuristicLab.Core/Auxiliary.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Static helper class. 30 /// </summary> 28 31 public static class Auxiliary { 29 32 #region Cloning 33 /// <summary> 34 /// Clones the given <paramref name="obj"/> (deep clone). 35 /// </summary> 36 /// <remarks>Checks before clone if object has not already been cloned.</remarks> 37 /// <param name="obj">The object to clone.</param> 38 /// <param name="clonedObjects">A dictionary of all already cloned objects. (Needed to avoid cycles.)</param> 39 /// <returns>The cloned object.</returns> 30 40 public static object Clone(IStorable obj, IDictionary<Guid, object> clonedObjects) { 31 41 object clone; … … 38 48 39 49 #region Error Messages 50 /// <summary> 51 /// Shows an error message box with a given error <paramref name="message"/> and an OK-Button. 52 /// </summary> 53 /// <param name="message">The error message to display.</param> 40 54 public static void ShowErrorMessageBox(string message) { 41 55 MessageBox.Show(message, … … 44 58 MessageBoxIcon.Error); 45 59 } 60 /// <summary> 61 /// Shows an error message box with a given exception <paramref name="ex"/> and an OK-Button. 62 /// </summary> 63 /// <param name="ex">The exception to display.</param> 46 64 public static void ShowErrorMessageBox(Exception ex) { 47 65 MessageBox.Show(BuildErrorMessage(ex), … … 50 68 MessageBoxIcon.Error); 51 69 } 70 /// <summary> 71 /// Builds an error message out of an exception and formats it accordingly. 72 /// </summary> 73 /// <param name="ex">The exception to format.</param> 74 /// <returns>The formated message.</returns> 52 75 private static string BuildErrorMessage(Exception ex) { 53 76 StringBuilder sb = new StringBuilder(); … … 63 86 64 87 #region Constraint Violation Messages 88 /// <summary> 89 /// Shows a warning message box with an OK-Button, indicating that the given constraints were violated and so 90 /// the operation could not be completed. 91 /// </summary> 92 /// <param name="violatedConstraints">The constraints that could not be fulfilled.</param> 65 93 public static void ShowConstraintViolationMessageBox(ICollection<IConstraint> violatedConstraints) { 66 94 string message = BuildConstraintViolationMessage(violatedConstraints); … … 70 98 MessageBoxIcon.Warning); 71 99 } 100 /// <summary> 101 /// Shows a question message box with a yes-no option, where to choose whether to ignore 102 /// the given violated constraints and to complete the operation or not. 103 /// </summary> 104 /// <param name="violatedConstraints">The constraints that could not be fulfilled.</param> 105 /// <returns>The result of the choice ("Yes" = 6, "No" = 7).</returns> 72 106 public static DialogResult ShowIgnoreConstraintViolationMessageBox(ICollection<IConstraint> violatedConstraints) { 73 107 string message = BuildConstraintViolationMessage(violatedConstraints); … … 77 111 MessageBoxIcon.Question); 78 112 } 113 /// <summary> 114 /// Builds a message out of a given collection of violated constraints, 115 /// including the constraints type and description. 116 /// </summary> 117 /// <param name="violatedConstraints">The constraints that could not be fulfilled.</param> 118 /// <returns>The message to display.</returns> 79 119 private static string BuildConstraintViolationMessage(ICollection<IConstraint> violatedConstraints) { 80 120 StringBuilder sb = new StringBuilder(); -
trunk/sources/HeuristicLab.Core/ChooseItemDialog.cs
r42 r776 31 31 32 32 namespace HeuristicLab.Core { 33 /// <summary> 34 /// A dialog to select an item. 35 /// </summary> 33 36 public partial class ChooseItemDialog : Form { 34 37 #region Inner Class TreeNodeSorter … … 46 49 #endregion 47 50 51 /// <summary> 52 /// Gets or sets the caption of the dialog. 53 /// </summary> 54 /// <remarks>Uses property <see cref="Form.Text"/> of base class <see cref="System.Windows.Forms.Form"/>. 55 /// No own data storage present.</remarks> 48 56 public string Caption { 49 57 get { return Text; } … … 52 60 53 61 private IItem myItem; 62 /// <summary> 63 /// Gets the selected item. 64 /// </summary> 54 65 public IItem Item { 55 66 get { return myItem; } 56 67 } 57 68 69 /// <summary> 70 /// Initializes a new instance of <see cref="ChooseItemDialog"/>. 71 /// </summary> 72 /// <remarks>Calls <see cref="ChooseItemDialog(System.Type)"/> with the type of <see cref="IItem"/> 73 /// as parameter.</remarks> 58 74 public ChooseItemDialog() 59 75 : this(typeof(IItem)) { 60 76 } 61 77 /// <summary> 78 /// Initializes a new instance of <see cref="ChooseItemDialog"/> with 79 /// the given <paramref name="itemType"/>. 80 /// </summary> 81 /// <param name="itemType">The type of the items to choose from.</param> 62 82 public ChooseItemDialog(Type itemType) { 63 83 InitializeComponent(); -
trunk/sources/HeuristicLab.Core/ChooseOperatorDialog.cs
r2 r776 31 31 32 32 namespace HeuristicLab.Core { 33 /// <summary> 34 /// A dialog to select an operator out of a library. 35 /// </summary> 33 36 public partial class ChooseOperatorDialog : Form { 34 37 #region Inner Class TreeNodeSorter … … 49 52 50 53 private IOperator myOperator; 54 /// <summary> 55 /// Gets the selected operator. 56 /// </summary> 51 57 public IOperator Operator { 52 58 get { return myOperator; } 53 59 } 54 60 61 /// <summary> 62 /// Initializes a new instance of <see cref="ChooseOperatorDialog"/>. 63 /// </summary> 55 64 public ChooseOperatorDialog() { 56 65 InitializeComponent(); -
trunk/sources/HeuristicLab.Core/ChooseTypeDialog.cs
r2 r776 31 31 32 32 namespace HeuristicLab.Core { 33 /// <summary> 34 /// A dialog to select a specific type. 35 /// </summary> 33 36 public partial class ChooseTypeDialog : Form { 34 37 #region Inner Class TreeNodeSorter … … 46 49 #endregion 47 50 51 /// <summary> 52 /// Gets or sets the caption of the dialog. 53 /// </summary> 54 /// <remarks>Uses property <see cref="Form.Text"/> of base class <see cref="Form"/>. 55 /// No own data storage present.</remarks> 48 56 public string Caption { 49 57 get { return Text; } … … 52 60 53 61 private Type myType; 62 /// <summary> 63 /// Gets the selected type. 64 /// </summary> 54 65 public Type Type { 55 66 get { return myType; } 56 67 } 57 68 69 /// <summary> 70 /// Initializes a new instance of <see cref="ChooseTypeDialog"/>. 71 /// </summary> 72 /// <remarks>Calls <see cref="ChooseTypeDialog(Type)"/> with the type of <see cref="IItem"/> as 73 /// parameter.</remarks> 58 74 public ChooseTypeDialog() 59 75 : this(typeof(IItem)) { 60 76 } 61 77 78 /// <summary> 79 /// Initializes a new instance of <see cref="ChooseTypeDialog"/> with the given 80 /// <paramref name="baseType"/>. 81 /// </summary> 82 /// <param name="baseType">The base type of all chooseable types.</param> 62 83 public ChooseTypeDialog(Type baseType) { 63 84 InitializeComponent(); -
trunk/sources/HeuristicLab.Core/CompositeOperation.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Represents a class for operations consisting themselves of several operations. 30 /// Can also be executed in parallel. 31 /// </summary> 28 32 public class CompositeOperation : ItemBase, IOperation { 29 33 private bool myExecuteInParallel; 34 35 /// <summary> 36 /// Gets or sets the bool value, whether the operation should be executed in parallel or not. 37 /// </summary> 30 38 public bool ExecuteInParallel { 31 39 get { return myExecuteInParallel; } … … 33 41 } 34 42 private List<IOperation> myOperations; 43 /// <summary> 44 /// Gets all current operations. 45 /// <note type="caution"> Operations are read-only!</note> 46 /// </summary> 35 47 public IList<IOperation> Operations { 36 48 get { return myOperations.AsReadOnly(); } 37 49 } 38 50 51 /// <summary> 52 /// Initializes a new instance of <see cref="CompositeOperation"/>, the <see cref="ExecuteInParallel"/> 53 /// property set to <c>false</c>. 54 /// </summary> 39 55 public CompositeOperation() { 40 56 myOperations = new List<IOperation>(); … … 42 58 } 43 59 60 /// <summary> 61 /// Adds an operation to the current list of operations. 62 /// </summary> 63 /// <param name="operation">The operation to add.</param> 44 64 public void AddOperation(IOperation operation) { 45 65 myOperations.Add(operation); 46 66 } 67 /// <summary> 68 /// Removes an operation from the current list. 69 /// </summary> 70 /// <param name="operation">The operation to remove.</param> 47 71 public void RemoveOperation(IOperation operation) { 48 72 myOperations.Remove(operation); 49 73 } 50 74 75 /// <summary> 76 /// Clones the current instance of <see cref="CompositeOperation"/> (deep clone). 77 /// </summary> 78 /// <remarks>All operations of the current instance are cloned, too (deep clone), with the 79 /// <see cref="HeuristicLab.Core.Auxiliary.Clone"/> method of the class <see cref="Auxiliary"/>.</remarks> 80 /// <param name="clonedObjects">A dictionary of all already cloned objects. (Needed to avoid cycles.)</param> 81 /// <returns>The cloned operation as <see cref="CompositeOperation"/>.</returns> 51 82 public override object Clone(IDictionary<Guid, object> clonedObjects) { 52 83 CompositeOperation clone = new CompositeOperation(); … … 59 90 60 91 #region Persistence Methods 92 /// <summary> 93 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 94 /// </summary> 95 /// <remarks>Calls <see cref="HeuristicLab.Core.StorableBase.GetXmlNode"/> of base 96 /// class <see cref="ItemBase"/>.<br/> 97 /// The <see cref="ExecuteInParallel"/> property is saved as <see cref="XmlAttribute"/> with the 98 /// tag name <c>ExecuteInParallel</c>. A child node with tag name <c>Operations</c> is created where 99 /// all operations are saved as child nodes.</remarks> 100 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 101 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 102 /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param> 103 /// <returns>The saved <see cref="XmlNode"/>.</returns> 61 104 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 62 105 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 71 114 return node; 72 115 } 116 /// <summary> 117 /// Loads the persisted operation from the specified <paramref name="node"/>. 118 /// </summary> 119 /// <remarks>The <see cref="ExecuteInParallel"/> property must be saved as <see cref="XmlAttribute"/> 120 /// with the tag name <c>ExecuteInParallel</c>. <br/> 121 /// The single operations must be saved as child nodes of a node with tag name <c>Operations</c>, 122 /// being a child node of the current instance. <br/> 123 /// Calls <see cref="StorableBase.Populate"/> of base class <see cref="ItemBase"/>.</remarks> 124 /// <param name="node">The <see cref="XmlNode"/> where the operation is saved.</param> 125 /// <param name="restoredObjects">A dictionary of all already restored objects. (Needed to avoid cycles.)</param> 73 126 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 74 127 base.Populate(node, restoredObjects); -
trunk/sources/HeuristicLab.Core/ConstrainedItemBase.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Base class for all items that are subjects to restrictions. 30 /// </summary> 28 31 public abstract class ConstrainedItemBase : ItemBase, IConstrainedItem { 29 32 private List<IConstraint> myConstraints; 33 /// <summary> 34 /// Gets all current constraints. 35 /// <note type="caution"> The constraints are returned read-only.</note> 36 /// </summary> 30 37 public virtual ICollection<IConstraint> Constraints { 31 38 get { return myConstraints.AsReadOnly(); } 32 39 } 33 40 41 /// <summary> 42 /// Initializes a new instance of <see cref="ConstrainedItemBase"/>. 43 /// </summary> 34 44 protected ConstrainedItemBase() { 35 45 myConstraints = new List<IConstraint>(); 36 46 } 37 47 48 /// <summary> 49 /// Clones the current instance (deep clone). 50 /// </summary> 51 /// <remarks>Calls <see cref="StorableBase.Clone 52 /// (System.Collections.Generic.IDictionary<System.Guid, object>)"/> 53 /// of base class <see cref="ItemBase"/>.<br/> 54 /// Deep clone through <see cref="Auxiliary.Clone"/> method of helper class 55 /// <see cref="Auxiliary"/>.</remarks> 56 /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param> 57 /// <returns>The cloned object as <see cref="ConstrainedItemBase"/>.</returns> 38 58 public override object Clone(IDictionary<Guid, object> clonedObjects) { 39 59 ConstrainedItemBase clone = (ConstrainedItemBase)base.Clone(clonedObjects); … … 44 64 } 45 65 66 /// <summary> 67 /// Adds the given <paramref name="constraint"/> to the current list. 68 /// </summary> 69 /// <remarks>Calls <see cref="OnConstraintAdded"/>.</remarks> 70 /// <param name="constraint">The constraint to add.</param> 46 71 public virtual void AddConstraint(IConstraint constraint) { 47 72 myConstraints.Add(constraint); 48 73 OnConstraintAdded(constraint); 49 74 } 75 /// <summary> 76 /// Removes the given <paramref name="constraint"/> from the current list. 77 /// </summary> 78 /// <remarks>Calls <see cref="OnConstraintRemoved"/> if the constraint can be successfully removed.</remarks> 79 /// <param name="constraint">The constraint to remove.</param> 50 80 public virtual void RemoveConstraint(IConstraint constraint) { 51 81 if (myConstraints.Remove(constraint)) … … 53 83 } 54 84 85 /// <summary> 86 /// Checks all constraints of the current instance. 87 /// </summary> 88 /// <returns><c>true</c> if all constraints could be fulfilled, <c>false</c> otherwise.</returns> 55 89 public bool IsValid() { 56 90 bool result = true; … … 59 93 return result; 60 94 } 95 /// <summary> 96 /// Checks all constraints of the current instance. 97 /// </summary> 98 /// <param name="violatedConstraints">Output parameter; contains all constraints that could not be 99 /// fulfilled.</param> 100 /// <returns><c>true</c> if all constraints could be fulfilled, <c>false</c> otherwise.</returns> 61 101 public bool IsValid(out ICollection<IConstraint> violatedConstraints) { 62 102 bool result = true; … … 71 111 } 72 112 113 /// <summary> 114 /// Creates an instance of <see cref="ConstrainedItemBaseView"/> 115 /// to represent the current instance visually. 116 /// </summary> 117 /// <returns>The created view as <see cref="ConstrainedItemBase"/>.</returns> 73 118 public override IView CreateView() { 74 119 return new ConstrainedItemBaseView(this); 75 120 } 76 121 122 /// <summary> 123 /// Occurs when a constraint is added. 124 /// </summary> 77 125 public event EventHandler<ConstraintEventArgs> ConstraintAdded; 126 /// <summary> 127 /// Fires a new <c>ConstraintAdded</c> event. 128 /// </summary> 129 /// <param name="constraint">The constraint that was added.</param> 78 130 protected virtual void OnConstraintAdded(IConstraint constraint) { 79 131 if (ConstraintAdded != null) 80 132 ConstraintAdded(this, new ConstraintEventArgs(constraint)); 81 133 } 134 /// <summary> 135 /// Occurs when a constraint is removed. 136 /// </summary> 82 137 public event EventHandler<ConstraintEventArgs> ConstraintRemoved; 138 /// <summary> 139 /// Fires a new <c>ConstraintRemoved</c> event. 140 /// </summary> 141 /// <param name="constraint">The constraint that was removed.</param> 83 142 protected virtual void OnConstraintRemoved(IConstraint constraint) { 84 143 if (ConstraintRemoved != null) … … 86 145 } 87 146 88 #region Persistence Methods 147 #region Persistence Methods 148 /// <summary> 149 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 150 /// </summary> 151 /// <remarks>Calls <see cref="StorableBase.GetXmlNode"/> of base class <see cref="ItemBase"/>. <br/> 152 /// For saving the constraints a child node is created having the tag name <c>Constraints</c>. Beyond this 153 /// child node all constraints are saved as child nodes themselves.</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. 157 /// (Needed to avoid cycles.)</param> 158 /// <returns>The saved <see cref="XmlNode"/>.</returns> 89 159 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) { 90 160 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 97 167 return node; 98 168 } 169 /// <summary> 170 /// Loads the persisted item from the specified <paramref name="node"/>. 171 /// </summary> 172 /// <remarks>See <see cref="GetXmlNode"/> to get information about how the constrained item must 173 /// be saved. <br/> 174 /// Calls <see cref="StorableBase.Populate"/> of base class <see cref="ItemBase"/>.</remarks> 175 /// <param name="node">The <see cref="XmlNode"/> where the constrained item is saved.</param> 176 /// <param name="restoredObjects">The dictionary of all already restored objects. 177 /// (Needed to avoid cycles.)</param> 99 178 public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 100 179 base.Populate(node, restoredObjects); -
trunk/sources/HeuristicLab.Core/ConstrainedItemBaseView.cs
r2 r776 29 29 30 30 namespace HeuristicLab.Core { 31 /// <summary> 32 /// The visual representation of an <see cref="IConstrainedItem"/>. 33 /// </summary> 31 34 public partial class ConstrainedItemBaseView : ViewBase { 32 35 private ChooseItemDialog chooseItemDialog; 33 36 37 /// <summary> 38 /// Gets or sets the current item to represent visually. 39 /// </summary> 34 40 public IConstrainedItem ConstrainedItem { 35 41 get { return (IConstrainedItem)Item; } … … 37 43 } 38 44 45 /// <summary> 46 /// Initializes a new instance of <see cref="ConstrainedItemBaseView"/> 47 /// with the caption "Constrained Item". 48 /// </summary> 39 49 public ConstrainedItemBaseView() { 40 50 InitializeComponent(); … … 42 52 Caption = "Constrained Item"; 43 53 } 54 /// <summary> 55 /// Initializes a new instance of <see cref="ConstrainedItemBaseView"/> with the given 56 /// <paramref name="constraintItem"/>. 57 /// </summary> 58 /// <param name="constraintItem">The item to represent visually.</param> 44 59 public ConstrainedItemBaseView(IConstrainedItem constraintItem) 45 60 : this() { … … 47 62 } 48 63 64 /// <summary> 65 /// Removes the event handlers from the underlying <see cref="IConstrainedItem"/>. 66 /// </summary> 67 /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 49 68 protected override void RemoveItemEvents() { 50 69 ConstrainedItem.ConstraintAdded -= new EventHandler<ConstraintEventArgs>(ConstrainedItemBase_ConstraintAdded); … … 52 71 base.RemoveItemEvents(); 53 72 } 73 /// <summary> 74 /// Adds event handlers to the underlying <see cref="IConstrainedItem"/>. 75 /// </summary> 76 /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 54 77 protected override void AddItemEvents() { 55 78 base.AddItemEvents(); … … 58 81 } 59 82 83 /// <summary> 84 /// Updates all controls with the latest data of the model. 85 /// </summary> 86 /// <remarks>Calls <see cref="ViewBase.UpdateControls"/> of base class <see cref="ViewBase"/>.</remarks> 60 87 protected override void UpdateControls() { 61 88 base.UpdateControls(); -
trunk/sources/HeuristicLab.Core/ConstraintEventArgs.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Event arguments to be able to specify the affected constraint. 29 /// </summary> 27 30 public class ConstraintEventArgs : ItemEventArgs { 31 /// <summary> 32 /// Gets the affected constraint. 33 /// </summary> 34 /// <remarks>Uses property <see cref="ItemEventArgs.Item"/> of base class <see cref="ItemEventArgs"/>. 35 /// No own data storage present.</remarks> 28 36 public IConstraint Constraint { 29 37 get { return (IConstraint)Item; } 30 38 } 31 39 40 /// <summary> 41 /// Initializes a new instance of <see cref="ConstraintEventArgs"/> with the given 42 /// <paramref name="constraint"/>. 43 /// </summary> 44 /// <remarks>Only calls the constructor of base class <see cref="ItemEventArgs"/>.</remarks> 45 /// <param name="constraint">The affected constraint.</param> 32 46 public ConstraintEventArgs(IConstraint constraint) 33 47 : base(constraint) { -
trunk/sources/HeuristicLab.Core/EditorBase.cs
r2 r776 29 29 30 30 namespace HeuristicLab.Core { 31 /// <summary> 32 /// Base class for views that can load and save data. 33 /// </summary> 31 34 public partial class EditorBase : ViewBase, IEditor { 32 35 private string myFilename; 36 /// <summary> 37 /// Gets or sets the filename of the current editor. 38 /// </summary> 39 /// <remarks>Calls <see cref="OnFilenameChanged"/> in the setter if the filename is new.</remarks> 33 40 public string Filename { 34 41 get { return myFilename; } … … 41 48 } 42 49 50 /// <summary> 51 /// Initializes a new instance of <see cref="EditorBase"/> with the caption "Editor". 52 /// </summary> 43 53 public EditorBase() { 44 54 InitializeComponent(); … … 46 56 } 47 57 58 /// <summary> 59 /// Updates all controls with the latest data of the model. 60 /// </summary> 61 /// <remarks>Calls <see cref="ViewBase.UpdateControls"/> of base class <see cref="ViewBase"/>.</remarks> 48 62 protected override void UpdateControls() { 49 63 base.UpdateControls(); … … 54 68 } 55 69 70 /// <summary> 71 /// Occurs when the filename is changed. 72 /// </summary> 56 73 public event EventHandler FilenameChanged; 74 /// <summary> 75 /// Fires a new <c>FilenameChanged</c> event. 76 /// </summary> 57 77 protected virtual void OnFilenameChanged() { 58 78 if (FilenameChanged != null) -
trunk/sources/HeuristicLab.Core/EngineBase.cs
r47 r776 27 27 28 28 namespace HeuristicLab.Core { 29 /// <summary> 30 /// Base class to represent an engine, which is an interpreter, holding the code, the data and 31 /// the actual state, which is the runtime stack and a pointer onto the next operation. It represents 32 /// one execution and can handle parallel executions. 33 /// </summary> 29 34 public abstract class EngineBase : ItemBase, IEngine { 35 /// <summary> 36 /// Field of the current instance that represent the operator graph. 37 /// </summary> 30 38 protected IOperatorGraph myOperatorGraph; 39 /// <summary> 40 /// Gets the current operator graph. 41 /// </summary> 31 42 public IOperatorGraph OperatorGraph { 32 43 get { return myOperatorGraph; } 33 44 } 45 /// <summary> 46 /// Field of the current instance that represent the global scope. 47 /// </summary> 34 48 protected IScope myGlobalScope; 49 /// <summary> 50 /// Gets the current global scope. 51 /// </summary> 35 52 public IScope GlobalScope { 36 53 get { return myGlobalScope; } … … 38 55 39 56 private TimeSpan myExecutionTime; 57 /// <summary> 58 /// Gets or sets the execution time. 59 /// </summary> 60 /// <remarks>Calls <see cref="OnExecutionTimeChanged"/> in the setter.</remarks> 40 61 public TimeSpan ExecutionTime { 41 62 get { return myExecutionTime; } … … 46 67 } 47 68 69 /// <summary> 70 /// Field of the current instance that represent the execution stack. 71 /// </summary> 48 72 protected Stack<IOperation> myExecutionStack; 73 /// <summary> 74 /// Gets the current execution stack. 75 /// </summary> 49 76 public Stack<IOperation> ExecutionStack { 50 77 get { return myExecutionStack; } 51 78 } 79 80 /// <summary> 81 /// Flag of the current instance whether it is currently running. 82 /// </summary> 52 83 protected bool myRunning; 84 /// <summary> 85 /// Gets information whether the instance is currently running. 86 /// </summary> 53 87 public bool Running { 54 88 get { return myRunning; } 55 89 } 90 91 /// <summary> 92 /// Flag of the current instance whether it is canceled. 93 /// </summary> 56 94 protected bool myCanceled; 95 /// <summary> 96 /// Gets information whether the instance is currently canceled. 97 /// </summary> 57 98 public bool Canceled { 58 99 get { return myCanceled; } 59 100 } 101 /// <summary> 102 /// Gets information whether the instance has already terminated. 103 /// </summary> 60 104 public virtual bool Terminated { 61 105 get { return ExecutionStack.Count == 0; } 62 106 } 63 107 108 /// <summary> 109 /// Initializes a new instance of <see cref="EngineBase"/> with a new global scope. 110 /// </summary> 111 /// <remarks>Calls <see cref="Reset"/>.</remarks> 64 112 protected EngineBase() { 65 113 myOperatorGraph = new OperatorGraph(); … … 69 117 } 70 118 119 /// <summary> 120 /// Clones the current instance (deep clone). 121 /// </summary> 122 /// <remarks>Deep clone through <see cref="Auxiliary.Clone"/> method of helper class 123 /// <see cref="Auxiliary"/>.</remarks> 124 /// <param name="clonedObjects">Dictionary of all already clone objects. (Needed to avoid cycles.)</param> 125 /// <returns>The cloned object as <see cref="EngineBase"/>.</returns> 71 126 public override object Clone(IDictionary<Guid, object> clonedObjects) { 72 127 EngineBase clone = (EngineBase)base.Clone(clonedObjects); … … 84 139 } 85 140 141 /// <inheritdoc/> 142 /// <remarks>Calls <see cref="ThreadPool.QueueUserWorkItem(System.Threading.WaitCallback, object)"/> 143 /// of class <see cref="ThreadPool"/>.</remarks> 86 144 public virtual void Execute() { 87 145 myRunning = true; … … 89 147 ThreadPool.QueueUserWorkItem(new WaitCallback(Run), null); 90 148 } 149 /// <inheritdoc/> 150 /// <remarks>Calls <see cref="ThreadPool.QueueUserWorkItem(System.Threading.WaitCallback, object)"/> 151 /// of class <see cref="ThreadPool"/>.</remarks> 91 152 public virtual void ExecuteSteps(int steps) { 92 153 myRunning = true; … … 94 155 ThreadPool.QueueUserWorkItem(new WaitCallback(Run), steps); 95 156 } 157 /// <inheritdoc/> 158 /// <remarks>Calls <see cref="ThreadPool.QueueUserWorkItem(System.Threading.WaitCallback, object)"/> 159 /// of class <see cref="ThreadPool"/>.</remarks> 96 160 public void ExecuteStep() { 97 161 ExecuteSteps(1); 98 162 } 163 /// <inheritdoc/> 164 /// <remarks>Sets the protected flag <c>myCanceled</c> to <c>true</c>.</remarks> 99 165 public virtual void Abort() { 100 166 myCanceled = true; 101 167 } 168 /// <inheritdoc/> 169 /// <remarks>Sets <c>myCanceled</c> and <c>myRunning</c> to <c>false</c>. The global scope is cleared, 170 /// the execution time is reseted, the execution stack is cleared and a new <see cref="AtomicOperation"/> 171 /// with the initial operator is added. <br/> 172 /// Calls <see cref="OnInitialized"/>.</remarks> 102 173 public virtual void Reset() { 103 174 myCanceled = false; … … 142 213 } 143 214 215 /// <summary> 216 /// Performs the next operation. 217 /// </summary> 144 218 protected abstract void ProcessNextOperation(); 145 219 220 /// <summary> 221 /// Occurs when the current instance is initialized. 222 /// </summary> 146 223 public event EventHandler Initialized; 224 /// <summary> 225 /// Fires a new <c>Initialized</c> event. 226 /// </summary> 147 227 protected virtual void OnInitialized() { 148 228 if (Initialized != null) 149 229 Initialized(this, new EventArgs()); 150 230 } 231 /// <summary> 232 /// Occurs when an operation is executed. 233 /// </summary> 151 234 public event EventHandler<OperationEventArgs> OperationExecuted; 235 /// <summary> 236 /// Fires a new <c>OperationExecuted</c> event. 237 /// </summary> 238 /// <param name="operation">The operation that has been executed.</param> 152 239 protected virtual void OnOperationExecuted(IOperation operation) { 153 240 if (OperationExecuted != null) 154 241 OperationExecuted(this, new OperationEventArgs(operation)); 155 242 } 243 /// <summary> 244 /// Occurs when an exception occured during the execution. 245 /// </summary> 156 246 public event EventHandler<ExceptionEventArgs> ExceptionOccurred; 247 /// <summary> 248 /// Aborts the execution and fires a new <c>ExceptionOccurred</c> event. 249 /// </summary> 250 /// <param name="exception">The exception that was thrown.</param> 157 251 protected virtual void OnExceptionOccurred(Exception exception) { 158 252 Abort(); … … 160 254 ExceptionOccurred(this, new ExceptionEventArgs(exception)); 161 255 } 256 /// <summary> 257 /// Occurs when the execution time changed. 258 /// </summary> 162 259 public event EventHandler ExecutionTimeChanged; 260 /// <summary> 261 /// Fires a new <c>ExecutionTimeChanged</c> event. 262 /// </summary> 163 263 protected virtual void OnExecutionTimeChanged() { 164 264 if (ExecutionTimeChanged != null) 165 265 ExecutionTimeChanged(this, new EventArgs()); 166 266 } 267 /// <summary> 268 /// Occurs when the execution is finished. 269 /// </summary> 167 270 public event EventHandler Finished; 271 /// <summary> 272 /// Fires a new <c>Finished</c> event. 273 /// </summary> 168 274 protected virtual void OnFinished() { 169 275 if (Finished != null) … … 172 278 173 279 #region Persistence Methods 280 /// <summary> 281 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 282 /// </summary> 283 /// <remarks>Calls <see cref="StorableBase.GetXmlNode"/> of base class <see cref="ItemBase"/>.<br/> 284 /// A quick overview how the single elements of the current instance are saved: 285 /// <list type="bullet"> 286 /// <item> 287 /// <term>Operator graph: </term> 288 /// <description>Saved as a child node with the tag name <c>OperatorGraph</c>.</description> 289 /// </item> 290 /// <item> 291 /// <term>Global scope: </term> 292 /// <description>Saved as a child node with the tag name <c>GlobalScope</c>.</description> 293 /// </item> 294 /// <item> 295 /// <term>Execution stack: </term> 296 /// <description>A child node is created with the tag name <c>ExecutionStack</c>. Beyond this child node 297 /// all operations of the execution stack are saved as child nodes.</description> 298 /// </item> 299 /// <item> 300 /// <term>Execution time: </term> 301 /// <description>Saved as a child node with the tag name <c>ExecutionTime</c>, where the execution 302 /// time is saved as string in the node's inner text.</description> 303 /// </item> 304 /// </list></remarks> 305 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 306 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 307 /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param> 308 /// <returns>The saved <see cref="XmlNode"/>.</returns> 174 309 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) { 175 310 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 190 325 return node; 191 326 } 327 /// <summary> 328 /// Loads the persisted instance from the specified <paramref name="node"/>. 329 /// </summary> 330 /// <remarks>See <see cref="GetXmlNode"/> to get information on how the instance must be saved. <br/> 331 /// Calls <see cref="StorableBase.Populate"/> of base class <see cref="ItemBase"/>.</remarks> 332 /// <param name="node">The <see cref="XmlNode"/> where the engine is saved.</param> 333 /// <param name="restoredObjects">The dictionary of all already restored objects. 334 /// (Needed to avoid cycles.)</param> 192 335 public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 193 336 base.Populate(node, restoredObjects); -
trunk/sources/HeuristicLab.Core/EngineBaseEditor.cs
r2 r776 30 30 31 31 namespace HeuristicLab.Core { 32 /// <summary> 33 /// Base class for editors of engines. 34 /// </summary> 32 35 public partial class EngineBaseEditor : EditorBase { 33 36 private int executionTimeCounter; 34 37 38 /// <summary> 39 /// Gets or sets the current engine. 40 /// </summary> 41 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="EditorBase"/>.</remarks> 35 42 public IEngine Engine { 36 43 get { return (IEngine)Item; } … … 38 45 } 39 46 47 /// <summary> 48 /// Initializes a new instance of <see cref="EngineBaseEditor"/>. 49 /// </summary> 40 50 public EngineBaseEditor() { 41 51 InitializeComponent(); 42 52 } 43 53 54 /// <summary> 55 /// Removes the event handlers from the underlying <see cref="IEngine"/>. 56 /// </summary> 57 /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 44 58 protected override void RemoveItemEvents() { 45 59 Engine.Initialized -= new EventHandler(Engine_Initialized); … … 51 65 base.RemoveItemEvents(); 52 66 } 67 /// <summary> 68 /// Adds event handlers to the underlying <see cref="IEngine"/>. 69 /// </summary> 70 /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 53 71 protected override void AddItemEvents() { 54 72 base.AddItemEvents(); … … 61 79 } 62 80 81 /// <summary> 82 /// Updates all controls with the latest data of the model. 83 /// </summary> 84 /// <remarks>Calls <see cref="EditorBase.UpdateControls"/> of base class <see cref="EditorBase"/>.</remarks> 63 85 protected override void UpdateControls() { 64 86 base.UpdateControls(); -
trunk/sources/HeuristicLab.Core/ExceptionEventArgs.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Event arguments to be able to specify the affected exception. 29 /// </summary> 27 30 public class ExceptionEventArgs : EventArgs { 28 31 private Exception myException; 32 /// <summary> 33 /// Gets the affected exception. 34 /// </summary> 29 35 public Exception Exception { 30 36 get { return myException; } 31 37 } 32 38 39 /// <summary> 40 /// Initializes a new instance of <see cref="ExceptionEventArgs"/> 41 /// with the given <paramref name="exception"/>. 42 /// </summary> 43 /// <param name="exception">The affected exception.</param> 33 44 public ExceptionEventArgs(Exception exception) { 34 45 myException = exception; -
trunk/sources/HeuristicLab.Core/HeuristicLab.Core.csproj
r582 r776 3 3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 4 4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 5 <ProductVersion>9.0. 30729</ProductVersion>5 <ProductVersion>9.0.21022</ProductVersion> 6 6 <SchemaVersion>2.0</SchemaVersion> 7 7 <ProjectGuid>{F43B59AB-2B8C-4570-BC1E-15592086517C}</ProjectGuid> -
trunk/sources/HeuristicLab.Core/HeuristicLabCorePlugin.cs
r582 r776 27 27 28 28 namespace HeuristicLab.Core { 29 /// <summary> 30 /// Plugin class for HeuristicLab.Core plugin. 31 /// </summary> 29 32 [ClassInfo(Name = "HeuristicLab.Core-3.2")] 30 33 [PluginFile(Filename = "HeuristicLab.Core-3.2.dll", Filetype = PluginFileType.Assembly)] -
trunk/sources/HeuristicLab.Core/Interfaces/IConstrainedItem.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent items that are subjects to restrictions. 29 /// </summary> 27 30 public interface IConstrainedItem : IItem { 31 /// <summary> 32 /// All constraints of the current instance. 33 /// </summary> 28 34 ICollection<IConstraint> Constraints { get; } 29 35 36 /// <summary> 37 /// Adds a constraint to the current instance. 38 /// </summary> 39 /// <param name="constraint">The constraint to add.</param> 30 40 void AddConstraint(IConstraint constraint); 41 /// <summary> 42 /// Removes a constraint from the current instance. 43 /// </summary> 44 /// <param name="constraint">The constraint to remove.</param> 31 45 void RemoveConstraint(IConstraint constraint); 32 46 47 /// <summary> 48 /// Checks whether the current instance fullfills all constraints. 49 /// </summary> 50 /// <returns><c>true</c> if all constraints are fullfilled, <c>false</c> otherwise.</returns> 33 51 bool IsValid(); 52 /// <summary> 53 /// Checks whether the current instance fullfills all constraints. 54 /// </summary> 55 /// <param name="violatedConstraints">Output parameter, all constraints that could not be fullfilled.</param> 56 /// <returns><c>true</c> if all constraints are fullfilled, <c>false</c> otherwise.</returns> 34 57 bool IsValid(out ICollection<IConstraint> violatedConstraints); 35 58 59 /// <summary> 60 /// An <see cref="EventHandler"/> for events when a new constraint is added. 61 /// </summary> 36 62 event EventHandler<ConstraintEventArgs> ConstraintAdded; 63 /// <summary> 64 /// An <see cref="EventHandler"/> for events when a constraint is deleted. 65 /// </summary> 37 66 event EventHandler<ConstraintEventArgs> ConstraintRemoved; 38 67 } -
trunk/sources/HeuristicLab.Core/Interfaces/IConstraint.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent restrictions. 29 /// </summary> 27 30 public interface IConstraint : IItem { 31 /// <summary> 32 /// Gets the description of the current instance. 33 /// </summary> 28 34 string Description { get; } 29 35 36 /// <summary> 37 /// Checks whether the given <paramref name="data"/> fulfills the current constraint. 38 /// </summary> 39 /// <param name="data">The item to check.</param> 40 /// <returns><c>true</c> if the current instance could be fulfilled, <c>false</c> otherwise.</returns> 30 41 bool Check(IItem data); 31 42 } -
trunk/sources/HeuristicLab.Core/Interfaces/IEditable.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent editable items. 29 /// </summary> 27 30 public interface IEditable : IViewable { 31 /// <summary> 32 /// Creates an editor. 33 /// </summary> 34 /// <returns>The created editor as <see cref="IEditor"/>.</returns> 28 35 IEditor CreateEditor(); 29 36 } -
trunk/sources/HeuristicLab.Core/Interfaces/IEditor.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent an editor. 29 /// </summary> 27 30 public interface IEditor : IView { 31 32 /// <summary> 33 /// Gets or sets the filename. 34 /// </summary> 28 35 string Filename { get; set; } 29 36 37 /// <summary> 38 /// Occurs when the filename was changed. 39 /// </summary> 30 40 event EventHandler FilenameChanged; 31 41 } -
trunk/sources/HeuristicLab.Core/Interfaces/IEngine.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent one run. (An engine is an interpreter, holding the code, 29 /// the data and the actual state, which is the runtime stack and a pointer onto the next operation.). 30 /// It is responsible for operator execution and able to deal with parallelism. 31 /// </summary> 27 32 public interface IEngine : IItem { 33 /// <summary> 34 /// Gets the operator graph of the current instance. 35 /// </summary> 28 36 IOperatorGraph OperatorGraph { get; } 37 /// <summary> 38 /// Gets the global scope of the current instance. 39 /// </summary> 29 40 IScope GlobalScope { get; } 30 41 42 /// <summary> 43 /// Gets the execution time of the current instance. 44 /// </summary> 31 45 TimeSpan ExecutionTime { get; } 32 46 47 /// <summary> 48 /// Gets information whether the engine is currently running. 49 /// </summary> 33 50 bool Running { get; } 51 /// <summary> 52 /// Gets information whether the engine is canceled. 53 /// </summary> 34 54 bool Canceled { get; } 55 /// <summary> 56 /// Gets information whether the engine has already terminated. 57 /// </summary> 35 58 bool Terminated { get; } 36 59 60 /// <summary> 61 /// Executes the whole run. 62 /// </summary> 37 63 void Execute(); 64 /// <summary> 65 /// Executes one step (one operation). 66 /// </summary> 38 67 void ExecuteStep(); 68 /// <summary> 69 /// Executes the given number of steps. 70 /// </summary> 71 /// <param name="steps">The number of steps to execute.</param> 39 72 void ExecuteSteps(int steps); 73 /// <summary> 74 /// Aborts the engine run. 75 /// </summary> 40 76 void Abort(); 77 /// <summary> 78 /// Resets the current instance. 79 /// </summary> 41 80 void Reset(); 42 81 82 /// <summary> 83 /// Occurs when the current instance is initialized. 84 /// </summary> 43 85 event EventHandler Initialized; 86 /// <summary> 87 /// Occurs when an operation is executed. 88 /// </summary> 44 89 event EventHandler<OperationEventArgs> OperationExecuted; 90 /// <summary> 91 /// Occurs when an exception was thrown. 92 /// </summary> 45 93 event EventHandler<ExceptionEventArgs> ExceptionOccurred; 94 /// <summary> 95 /// Occurs when the execution time was changed. 96 /// </summary> 46 97 event EventHandler ExecutionTimeChanged; 98 /// <summary> 99 /// Occurs when the engine is finished. 100 /// </summary> 47 101 event EventHandler Finished; 48 102 } -
trunk/sources/HeuristicLab.Core/Interfaces/IItem.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent (almost) every HeuristicLab object (an object, an operator,...). 29 /// </summary> 27 30 public interface IItem : IStorable, IViewable { 31 /// <summary> 32 /// Fires a new <c>Changed</c> event. 33 /// </summary> 28 34 void FireChanged(); 29 35 36 /// <summary> 37 /// Occurs when the current instance has changed. 38 /// </summary> 30 39 event EventHandler Changed; 31 40 } -
trunk/sources/HeuristicLab.Core/Interfaces/IOperation.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent an operation (Executes a defined number of operators on a defined scope). 29 /// </summary> 27 30 public interface IOperation : IItem { 28 31 } -
trunk/sources/HeuristicLab.Core/Interfaces/IOperator.cs
r47 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent an operator (e.g. GreaterThanComparator,...), 29 /// a basic instruction of an algorithm. 30 /// </summary> 27 31 public interface IOperator : IConstrainedItem { 32 /// <summary> 33 /// Gets or sets the name of the current instance. 34 /// </summary> 28 35 string Name { get; set; } 36 /// <summary> 37 /// Gets or sets the description of the current instance. 38 /// </summary> 29 39 string Description { get; } 30 40 41 /// <summary> 42 /// Gets information whether the current operator has been canceled. 43 /// </summary> 31 44 bool Canceled { get; } 45 /// <summary> 46 /// Gets or sets a boolean value whether the engine should stop here during the run. 47 /// </summary> 32 48 bool Breakpoint { get; set; } 33 49 50 /// <summary> 51 /// Gets a list of all sub operators. 52 /// </summary> 34 53 IList<IOperator> SubOperators { get; } 54 /// <summary> 55 /// Gets a collection of all variable (parameter) infos. 56 /// </summary> 35 57 ICollection<IVariableInfo> VariableInfos { get; } 58 /// <summary> 59 /// Gets a collection of all variables of the current operator. 60 /// </summary> 36 61 ICollection<IVariable> Variables { get; } 37 62 63 /// <summary> 64 /// Adds the given sub operator to the current instance. 65 /// </summary> 66 /// <param name="op">The operator to add.</param> 38 67 void AddSubOperator(IOperator op); 68 /// <summary> 69 /// Adds the given sub operator to the current instance if all constraints can be fulfilled. 70 /// </summary> 71 /// <param name="op">The operator to add.</param> 72 /// <returns><c>true</c> if the operator could be added without violating constraints, 73 /// <c>false</c> otherwise.</returns> 39 74 bool TryAddSubOperator(IOperator op); 75 /// <summary> 76 /// Adds the given sub operator to the current instance if all constraints can be fulfilled. 77 /// </summary> 78 /// <param name="op">The operator to add.</param> 79 /// <param name="violatedConstraints">Output parameter; contains all constraints that could not be 80 /// fulfilled.</param> 81 /// <returns><c>true</c> if the operator could be added without violating constraints, 82 /// <c>false</c> otherwise.</returns> 40 83 bool TryAddSubOperator(IOperator op, out ICollection<IConstraint> violatedConstraints); 84 /// <summary> 85 /// Adds the given sub operator at a the specified <paramref name="index"/>. 86 /// </summary> 87 /// <param name="op">The operator to add.</param> 88 /// <param name="index">The position where to add the operator.</param> 41 89 void AddSubOperator(IOperator op, int index); 90 /// <summary> 91 /// Adds the given operator at the specified <paramref name="index"/> to the current instance 92 /// if all constraints can be fulfilled. 93 /// </summary> 94 /// <param name="op">The operator to add.</param> 95 /// <param name="index">The position where to add the operator.</param> 96 /// <returns><c>true</c> if the operator could be added without violating constraints, 97 /// <c>false</c> otherwise.</returns> 42 98 bool TryAddSubOperator(IOperator op, int index); 99 /// <summary> 100 /// Adds the given operator at the specified <paramref name="index"/> to the current instance 101 /// if all constraints can be fulfilled. 102 /// </summary> 103 /// <param name="op">The operator to add.</param> 104 /// <param name="index">The position where to add the operator.</param> 105 /// <param name="violatedConstraints">Output parameter; contains all constraints that could not be 106 /// fulfilled.</param> 107 /// <returns><c>true</c> if the operator could be added without violating constraints, 108 /// <c>false</c> otherwise.</returns> 43 109 bool TryAddSubOperator(IOperator op, int index, out ICollection<IConstraint> violatedConstraints); 110 /// <summary> 111 /// Removes a sub operator at the specified <paramref name="index"/>. 112 /// </summary> 113 /// <param name="index">The position where to delete the operator.</param> 44 114 void RemoveSubOperator(int index); 115 /// <summary> 116 /// Removes a sub operator at the specified <paramref name="index"/> if all constraint can be fulfilled. 117 /// </summary> 118 /// <param name="index">The position where to delete the operator.</param> 119 /// <returns><c>true</c> if the operator could be deleted without violating constraints, 120 /// <c>false</c> otherwise.</returns> 45 121 bool TryRemoveSubOperator(int index); 122 /// <summary> 123 /// Deletes the operator at the specified <paramref name="index"/> 124 /// if all constraints can be fulfilled. 125 /// </summary> 126 /// <param name="index">The position where to delete the operator.</param> 127 /// <param name="violatedConstraints">Output parameter; contains all constraints that could not be 128 /// fulfilled.</param> 129 /// <returns><c>true</c> if the operator could be deleted without violating constraints, 130 /// <c>false</c> otherwise.</returns> 46 131 bool TryRemoveSubOperator(int index, out ICollection<IConstraint> violatedConstraints); 47 132 133 /// <summary> 134 /// Gets the variable info with the given <paramref name="formalName"/>. 135 /// </summary> 136 /// <param name="formalName">The formal name of the variable info.</param> 137 /// <returns>The variable info with the specified formal name.</returns> 48 138 IVariableInfo GetVariableInfo(string formalName); 139 /// <summary> 140 /// Adds the specified variable info to the current instance. 141 /// </summary> 142 /// <param name="variableInfo">The variable info to add.</param> 49 143 void AddVariableInfo(IVariableInfo variableInfo); 144 /// <summary> 145 /// Adds the specified variable info to the current instance, if all constraints can be fulfilled. 146 /// </summary> 147 /// <param name="variableInfo">The variable info to add.</param> 148 /// <returns><c>true</c> if the variable info could be added without violating constraints, 149 /// <c>false</c> otherwise.</returns> 50 150 bool TryAddVariableInfo(IVariableInfo variableInfo); 151 /// <summary> 152 /// Adds the specified variable info to the current instance, if all constraints can be fulfilled. 153 /// </summary> 154 /// <param name="variableInfo">The variable info to add.</param> 155 /// <param name="violatedConstraints">Output parameter; contains all constraints that could not be 156 /// fulfilled.</param> 157 /// <returns><c>true</c> if the variable info could be added without violating constraints, 158 /// <c>false</c> otherwise.</returns> 51 159 bool TryAddVariableInfo(IVariableInfo variableInfo, out ICollection<IConstraint> violatedConstraints); 160 /// <summary> 161 /// Removes the variable info with the given formal name. 162 /// </summary> 163 /// <param name="formalName">The formal name of the variable info to remove.</param> 52 164 void RemoveVariableInfo(string formalName); 165 /// <summary> 166 /// Deletes the variable info with the given formal name, 167 /// if all constraints can be fulfilled. 168 /// </summary> 169 /// <param name="formalName">The formal name of the variable info to remove.</param> 170 /// <returns><c>true</c> if the variable info could be deleted without violating constraints, 171 /// <c>false</c> otherwise.</returns> 53 172 bool TryRemoveVariableInfo(string formalName); 173 /// <summary> 174 /// Deletes the variable info with the given formal name, 175 /// if all constraints can be fulfilled. 176 /// </summary> 177 /// <param name="formalName">The formal name of the variable info to remove.</param> 178 /// <param name="violatedConstraints">Output parameter; contains all constraints that could not be 179 /// fulfilled.</param> 180 /// <returns><c>true</c> if the variable info could be deleted without violating constraints, 181 /// <c>false</c> otherwise.</returns> 54 182 bool TryRemoveVariableInfo(string formalName, out ICollection<IConstraint> violatedConstraints); 55 183 184 /// <summary> 185 /// Gets a variable with the given <paramref name="name"/>. 186 /// </summary> 187 /// <param name="name">The name of the variable.</param> 188 /// <returns>The variable with the specified name.</returns> 56 189 IVariable GetVariable(string name); 190 /// <summary> 191 /// Adds the specified <paramref name="variable"/> to the current instance. 192 /// </summary> 193 /// <param name="variable">The variable to add.</param> 57 194 void AddVariable(IVariable variable); 195 /// <summary> 196 /// Adds the specified <paramref name="variable"/> to the current instance if all constraints can 197 /// be fulfilled. 198 /// </summary> 199 /// <param name="variable">The variable to add.</param> 200 /// <returns><c>true</c> if the variable could be added without violating constraints, 201 /// <c>false</c> otherwise.</returns> 58 202 bool TryAddVariable(IVariable variable); 203 /// <summary> 204 /// Adds the specified <paramref name="variable"/> to the current instance if all constraints can 205 /// be fulfilled. 206 /// </summary> 207 /// <param name="variable">The variable to add.</param> 208 /// <param name="violatedConstraints">Output parameter; contains all constraints that could 209 /// not be fulfillled.</param> 210 /// <returns><c>true</c> if the variable could be added without violating constraints, 211 /// <c>false</c> otherwise.</returns> 59 212 bool TryAddVariable(IVariable variable, out ICollection<IConstraint> violatedConstraints); 213 /// <summary> 214 /// Deletes the variable with the specified <paramref name="name"/>. 215 /// </summary> 216 /// <param name="name">The name of the variable to delete.</param> 60 217 void RemoveVariable(string name); 218 /// <summary> 219 /// Deletes the variable with the specified <paramref name="name"/> if all constraints can be 220 /// fulfilled. 221 /// </summary> 222 /// <param name="name">The name of the variable to remove.</param> 223 /// <returns><c>true</c> if the variable could be deleted without violating constraints, 224 /// <c>false</c> otherwise.</returns> 61 225 bool TryRemoveVariable(string name); 226 /// <summary> 227 /// Deletes the variable with the specified <paramref name="name"/> if all constraints can be 228 /// fulfilled. 229 /// </summary> 230 /// <param name="name">The name of the variable to remove.</param> 231 /// <param name="violatedConstraints">Output parameter; contains all constraints that could 232 /// not be fulfilled.</param> 233 /// <returns><c>true</c> if the variable could be deleted without violating constraints, 234 /// <c>false</c> otherwise.</returns> 62 235 bool TryRemoveVariable(string name, out ICollection<IConstraint> violatedConstraints); 236 237 /// <inheritdoc cref="GetVariableValue(string, HeuristicLab.Core.IScope, bool)"/> 238 /// <typeparam name="T">The type of the value that is searched.</typeparam> 63 239 T GetVariableValue<T>(string formalName, IScope scope, bool recursiveLookup) where T : class, IItem; 240 /// <inheritdoc cref="GetVariableValue(string, HeuristicLab.Core.IScope, bool, bool)"/> 241 /// <typeparam name="T">The type of the value that is searched.</typeparam> 64 242 T GetVariableValue<T>(string formalName, IScope scope, bool recursiveLookup, bool throwOnError) where T : class, IItem; 243 /// <inheritdoc cref="GetVariableValue(System.String, IScope, bool, bool)" 244 /// select="summary"/> 245 /// <param name="formalName">The formal name of the variable info whose variable value is searched.</param> 246 /// <param name="scope">The scope where to look for the variable.</param> 247 /// <param name="recursiveLookup">Boolean value, whether also the parent scopes shall be searched if 248 /// the variable is not found in the specified <paramref name="scope"/>.</param> 249 /// <returns>The value of the searched variable or null if it is not found.</returns> 65 250 IItem GetVariableValue(string formalName, IScope scope, bool recursiveLookup); 251 /// <summary> 252 /// Gets the value of the variable in the specified <paramref name="scope"/> 253 /// whose variable(parameter) info has the specified <paramref name="formalName"/>. 254 /// </summary> 255 /// <param name="formalName">The formal name of the variable info whose variable value is searched.</param> 256 /// <param name="scope">The scope where to look for the variable.</param> 257 /// <param name="recursiveLookup">Boolean value, whether also the parent scopes shall be searched if 258 /// the variable is not found in the specified <paramref name="scope"/>.</param> 259 /// <param name="throwOnError">Boolean value, whether an exception shall be thrown, if the variable 260 /// cannot be found or just <c>null</c> shall be returned.</param> 261 /// <returns>The value of the searched variable (or null if the variable is not 262 /// found and <paramref name="throwOnError"/> is set to false).</returns> 66 263 IItem GetVariableValue(string formalName, IScope scope, bool recursiveLookup, bool throwOnError); 67 264 265 /// <summary> 266 /// Executes the current instance on the specified <paramref name="scope"/>. 267 /// </summary> 268 /// <param name="scope">The scope where to execute the current instance.</param> 269 /// <returns>The next operation.</returns> 68 270 IOperation Execute(IScope scope); 271 /// <summary> 272 /// Aborts the current operator. 273 /// </summary> 69 274 void Abort(); 70 275 276 /// <summary> 277 /// Occurs when the name of the operator was changed. 278 /// </summary> 71 279 event EventHandler NameChanged; 72 event EventHandler BreakpointChanged; 280 /// <summary> 281 /// Occurs when the breakpoint flag of the current instance was changed. 282 /// </summary> 283 event EventHandler BreakpointChanged; 284 /// <summary> 285 /// Occurs when a sub operator has been added. 286 /// </summary> 73 287 event EventHandler<OperatorIndexEventArgs> SubOperatorAdded; 288 /// <summary> 289 /// Occurs when a sub operator has been deleted. 290 /// </summary> 74 291 event EventHandler<OperatorIndexEventArgs> SubOperatorRemoved; 292 /// <summary> 293 /// Occurs when a variable info has been added. 294 /// </summary> 75 295 event EventHandler<VariableInfoEventArgs> VariableInfoAdded; 296 /// <summary> 297 /// Occurs when a variable info has been deleted. 298 /// </summary> 76 299 event EventHandler<VariableInfoEventArgs> VariableInfoRemoved; 300 /// <summary> 301 /// Occurs when a variable has been added. 302 /// </summary> 77 303 event EventHandler<VariableEventArgs> VariableAdded; 304 /// <summary> 305 /// Occurs when a variable has been deleted. 306 /// </summary> 78 307 event EventHandler<VariableEventArgs> VariableRemoved; 308 /// <summary> 309 /// Occurs when the current instance is executed. 310 /// </summary> 79 311 event EventHandler Executed; 80 312 } -
trunk/sources/HeuristicLab.Core/Interfaces/IOperatorGraph.cs
r47 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface to represent an operator graph. 30 /// </summary> 28 31 public interface IOperatorGraph : IItem { 32 /// <summary> 33 /// Gets all operators of the current instance. 34 /// </summary> 29 35 ICollection<IOperator> Operators { get; } 36 /// <summary> 37 /// Gets or sets the initial operator (the starting one) of the current instance. 38 /// </summary> 30 39 IOperator InitialOperator { get; set; } 31 40 41 /// <summary> 42 /// Adds the given operator to the current instance. 43 /// </summary> 44 /// <param name="op">The operator to add.</param> 32 45 void AddOperator(IOperator op); 46 /// <summary> 47 /// Removes an operator with the specified <paramref name="guid"/> from the current instance. 48 /// </summary> 49 /// <param name="guid">The unique id of the operator to remove.</param> 33 50 void RemoveOperator(Guid guid); 51 /// <summary> 52 /// Gets the operator with the specified <paramref name="guid"/>. 53 /// </summary> 54 /// <param name="guid">The unique id of the operator.</param> 55 /// <returns>The searched operator.</returns> 34 56 IOperator GetOperator(Guid guid); 57 /// <summary> 58 /// Clears the current instance. 59 /// </summary> 35 60 void Clear(); 36 61 62 /// <summary> 63 /// Occurs when a new operator has been added to the current instance. 64 /// </summary> 37 65 event EventHandler<OperatorEventArgs> OperatorAdded; 66 /// <summary> 67 /// Occurs when an operator has been deleted from the current instance. 68 /// </summary> 38 69 event EventHandler<OperatorEventArgs> OperatorRemoved; 70 /// <summary> 71 /// Occurs when the initial operator (the starting one) has been changed. 72 /// </summary> 39 73 event EventHandler InitialOperatorChanged; 40 74 } -
trunk/sources/HeuristicLab.Core/Interfaces/IOperatorGroup.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface to represent a group of operators. 30 /// </summary> 28 31 public interface IOperatorGroup : IStorable { 32 /// <summary> 33 /// Gets or sets the name of the current instance. 34 /// </summary> 29 35 string Name { get; set; } 36 /// <summary> 37 /// Gets all sub groups of operators of the current instance. 38 /// </summary> 30 39 ICollection<IOperatorGroup> SubGroups { get; } 40 /// <summary> 41 /// Gets all operators of the current operator group. 42 /// </summary> 31 43 ICollection<IOperator> Operators { get; } 32 44 45 /// <summary> 46 /// Adds the specified sub group of operators to the current operator group. 47 /// </summary> 48 /// <param name="group">The operator group to add.</param> 33 49 void AddSubGroup(IOperatorGroup group); 50 /// <summary> 51 /// Deletes the specified sub group of operators from the current instance. 52 /// </summary> 53 /// <param name="group">The sub group to delete.</param> 34 54 void RemoveSubGroup(IOperatorGroup group); 55 /// <summary> 56 /// Adds the specified operator to the current instance. 57 /// </summary> 58 /// <param name="op">The operator to add.</param> 35 59 void AddOperator(IOperator op); 60 /// <summary> 61 /// Deletes the specified operator from the current instance. 62 /// </summary> 63 /// <param name="op">The operator to remove.</param> 36 64 void RemoveOperator(IOperator op); 37 65 66 /// <summary> 67 /// Occurs when the name of the operator group has been changed. 68 /// </summary> 38 69 event EventHandler NameChanged; 39 70 } -
trunk/sources/HeuristicLab.Core/Interfaces/IOperatorLibrary.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface to represent a library of operators. 30 /// </summary> 28 31 public interface IOperatorLibrary : IItem { 32 /// <summary> 33 /// Gets the operator group of the current instance. 34 /// </summary> 29 35 IOperatorGroup Group { get; } 30 36 } -
trunk/sources/HeuristicLab.Core/Interfaces/IRandom.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Represents an interface for random number generators. 30 /// </summary> 28 31 public interface IRandom : IItem { 32 /// <summary> 33 /// Resets the random number generator. 34 /// </summary> 29 35 void Reset(); 36 /// <summary> 37 /// Resets the random number generator with the given <paramref name="seed"/>. 38 /// </summary> 39 /// <param name="seed">The new seed.</param> 30 40 void Reset(int seed); 31 41 42 /// <summary> 43 /// Gets a new random number. 44 /// </summary> 45 /// <returns>A random integer number.</returns> 32 46 int Next(); 47 /// <summary> 48 /// Gets a new random number between 0 and <paramref name="maxVal"/>. 49 /// </summary> 50 /// <param name="maxVal">The maximal value of the random number.</param> 51 /// <returns>A random integer number smaller than or equal to <paramref name="maxVal"/>.</returns> 33 52 int Next(int maxVal); 53 /// <summary> 54 /// Gets a new random number between <paramref name="minVal"/> and <paramref name="maxVal"/>. 55 /// </summary> 56 /// <param name="maxVal">The maximal value of the random number.</param> 57 /// <param name="minVal">The minimal value of the random number.</param> 58 /// <returns>A random integer number. (<paramref name="minVal"/> <= x <= <paramref name="maxVal"/>.</returns> 34 59 int Next(int minVal, int maxVal); 60 /// <summary> 61 /// Gets a new double random number. 62 /// </summary> 63 /// <returns>A random double number.</returns> 35 64 double NextDouble(); 36 65 } -
trunk/sources/HeuristicLab.Core/Interfaces/IScope.cs
r63 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface for a hierarchical container of variables (containing variables and subscopes). 30 /// </summary> 28 31 public interface IScope : IItem { 32 /// <summary> 33 /// Gets the name of the current instance. 34 /// </summary> 29 35 string Name { get; } 30 36 37 /// <summary> 38 /// Gets the varibles of the current scope. 39 /// </summary> 31 40 ICollection<IVariable> Variables { get; } 41 /// <summary> 42 /// Gets all aliases of the current scope. 43 /// </summary> 32 44 IEnumerable<KeyValuePair<string, string>> Aliases { get; } 45 /// <summary> 46 /// Gets all subscopes in the current scope. 47 /// </summary> 33 48 IList<IScope> SubScopes { get; } 34 49 50 /// <summary> 51 /// Sets the parent scope for the current instance. 52 /// </summary> 53 /// <param name="scope">The parent scope of the current instance.</param> 35 54 void SetParent(IScope scope); 36 55 56 /// <summary> 57 /// Gets a variable with the given <paramref name="name"/>. 58 /// </summary> 59 /// <param name="name">The name of the variable.</param> 60 /// <returns>The variable with the specified name.</returns> 37 61 IVariable GetVariable(string name); 62 /// <summary> 63 /// Adds the specified variable to the curent instance. 64 /// </summary> 65 /// <param name="variable">The variable to add.</param> 38 66 void AddVariable(IVariable variable); 67 /// <summary> 68 /// Deletes a variable with the specified <paramref name="name"/> from the current instance. 69 /// </summary> 70 /// <param name="name">The name of the variable to delete.</param> 39 71 void RemoveVariable(string name); 72 73 /// <inheritdoc cref="GetVariableValue(string, bool)"/> 74 /// <typeparam name="T">The type of the value that is searched.</typeparam> 40 75 T GetVariableValue<T>(string name, bool recursiveLookup) where T : class, IItem; 76 /// <inheritdoc cref="GetVariableValue(string, bool, bool)"/> 77 /// <typeparam name="T">The type of the value that is searched.</typeparam> 41 78 T GetVariableValue<T>(string name, bool recursiveLookup, bool throwOnError) where T : class, IItem; 79 /// <inheritdoc cref="GetVariableValue(string, bool, bool)" select="summary"/> 80 /// <param name="name">The name of the variable.</param> 81 /// <param name="recursiveLookup">Boolean value, whether the parent scopes shall be searched 82 /// when the variable is not found in the current instance.</param> 83 /// <returns>The value of the variable or <c>null</c> if it was not found.</returns> 42 84 IItem GetVariableValue(string name, bool recursiveLookup); 85 /// <summary> 86 /// Gets the value of the variable with the given <paramref name="name"/>. 87 /// </summary> 88 /// <param name="name">The name of the variable.</param> 89 /// <param name="recursiveLookup">Boolean value, whether the parent scopes shall be searched 90 /// when the variable is not found in the current instance.</param> 91 /// <param name="throwOnError">Boolean value, whether an exception shall be thrown when the searched 92 /// variable cannot be found, or only <c>null</c> shall be returned.</param> 93 /// <returns>The value of the searched variable or <c>null</c> if <paramref name="throwOnError"/> 94 /// is set to <c>false</c>.</returns> 43 95 IItem GetVariableValue(string name, bool recursiveLookup, bool throwOnError); 44 96 97 /// <summary> 98 /// Gets the actual name the given alias. 99 /// </summary> 100 /// <param name="name">The alias whose actual name is searched.</param> 101 /// <returns>The actual name.</returns> 45 102 string TranslateName(string name); 103 /// <summary> 104 /// Adds an alias to the current instance. 105 /// </summary> 106 /// <param name="alias">The alias to add.</param> 107 /// <param name="name">The actual name of the alias.</param> 46 108 void AddAlias(string alias, string name); 109 /// <summary> 110 /// Deletes the specified <paramref name="alias"/> from the current instance. 111 /// </summary> 112 /// <param name="alias">The alias to delete.</param> 47 113 void RemoveAlias(string alias); 48 114 115 /// <summary> 116 /// Adds the specified sub scope to the current instance. 117 /// </summary> 118 /// <param name="scope">The sub scope to add.</param> 49 119 void AddSubScope(IScope scope); 120 /// <summary> 121 /// Deletes the specified sub scope from the current instance. 122 /// </summary> 123 /// <param name="scope">The sub scope to delete.</param> 50 124 void RemoveSubScope(IScope scope); 125 /// <summary> 126 /// Reorders all sub scopes according to the specified chronology. 127 /// </summary> 128 /// <param name="sequence">The chronology how to order the sub scopes.</param> 51 129 void ReorderSubScopes(int[] sequence); 130 /// <summary> 131 /// Gets the sub scope with the given <paramref name="guid"/>. 132 /// </summary> 133 /// <param name="guid">The unique identifier of the sub scope.</param> 134 /// <returns>The sub scope with the given <paramref name="guid"/>.</returns> 52 135 IScope GetScope(Guid guid); 136 /// <summary> 137 /// Gets the sub scope with the given <paramref name="name"/>. 138 /// </summary> 139 /// <param name="name">The name of the sub scope.</param> 140 /// <returns>The sub scope with the given <paramref name="name"/>.</returns> 53 141 IScope GetScope(string name); 54 142 143 /// <summary> 144 /// Clears the current instance. 145 /// </summary> 55 146 void Clear(); 56 147 148 /// <summary> 149 /// Occurs when a variable has been added to the current instance. 150 /// </summary> 57 151 event EventHandler<VariableEventArgs> VariableAdded; 152 /// <summary> 153 /// Occurs when a variable has been deleted from the current instance. 154 /// </summary> 58 155 event EventHandler<VariableEventArgs> VariableRemoved; 156 /// <summary> 157 /// Occurs when an alias has been added to the current instance. 158 /// </summary> 59 159 event EventHandler<AliasEventArgs> AliasAdded; 160 /// <summary> 161 /// Occurs when an alias has been removed from the current instance. 162 /// </summary> 60 163 event EventHandler<AliasEventArgs> AliasRemoved; 164 /// <summary> 165 /// Occurs when a sub scope has been added to the current instance. 166 /// </summary> 61 167 event EventHandler<ScopeIndexEventArgs> SubScopeAdded; 168 /// <summary> 169 /// Occurs when a sub scope has been deleted from the current instance. 170 /// </summary> 62 171 event EventHandler<ScopeIndexEventArgs> SubScopeRemoved; 172 /// <summary> 173 /// Occurs when the sub scopes have been reordered. 174 /// </summary> 63 175 event EventHandler SubScopesReordered; 64 176 } -
trunk/sources/HeuristicLab.Core/Interfaces/IStorable.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface to represent objects that are de- and serializeable. 30 /// </summary> 28 31 public interface IStorable { 32 /// <summary> 33 /// Gets the objects unique identifier. 34 /// </summary> 29 35 Guid Guid { get; } 30 36 37 /// <summary> 38 /// Clones the current instance (deep clone). 39 /// </summary> 40 /// <returns>The cloned object.</returns> 31 41 object Clone(); 42 /// <summary> 43 /// Clones the current instance, considering already cloned objects. 44 /// </summary> 45 /// <param name="clonedObjects">All already cloned objects. (Needed to avoid cycles.)</param> 46 /// <returns>The cloned object.</returns> 32 47 object Clone(IDictionary<Guid, object> clonedObjects); 33 48 49 /// <summary> 50 /// Saves the current instance as <see cref="XmlNode"/> in the specified 51 /// <typeparamref name="document"/>. 52 /// </summary> 53 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 54 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 55 /// <param name="persistedObjects">The dictionary of all already persisted objects. 56 /// (Needed to avoid cycles.)</param> 57 /// <returns>The saved <see cref="XmlNode"/>.</returns> 34 58 XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects); 59 /// <summary> 60 /// Loads the persisted object from the specified <paramref name="node"/>. 61 /// </summary> 62 /// <param name="node">The <see cref="XmlNode"/> where the object is saved.</param> 63 /// <param name="restoredObjects">A dictionary of all already restored objects. (Needed to avoid 64 /// cycles.)</param> 35 65 void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects); 36 66 } -
trunk/sources/HeuristicLab.Core/Interfaces/IVariable.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface to represent a variable (of an operator) having a name and a value. 30 /// </summary> 28 31 public interface IVariable : IItem { 32 /// <summary> 33 /// Gets or sets the name of the variable. 34 /// </summary> 29 35 string Name { get; set; } 36 /// <summary> 37 /// Gets or sets the value of the variable. 38 /// </summary> 30 39 IItem Value { get; set; } 31 40 41 /// <summary> 42 /// Gets the value of the variable. 43 /// </summary> 44 /// <typeparam name="T">The type of the variable's value.</typeparam> 45 /// <returns>The value of the current instance.</returns> 32 46 T GetValue<T>() where T : class, IItem; 33 47 48 /// <summary> 49 /// Occurs when the name of the variable is currently changing. 50 /// </summary> 34 51 event EventHandler<NameChangingEventArgs> NameChanging; 52 /// <summary> 53 /// Occurs when the name of the current instance has been changed. 54 /// </summary> 35 55 event EventHandler NameChanged; 56 /// <summary> 57 /// Occurs when the value of the current instance has been changed. 58 /// </summary> 36 59 event EventHandler ValueChanged; 37 60 } -
trunk/sources/HeuristicLab.Core/Interfaces/IVariableInfo.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface to store meta-information about variables/parameters of operators. 30 /// </summary> 28 31 public interface IVariableInfo : IItem { 32 /// <summary> 33 /// Gets or sets the actual name of the variable info. 34 /// </summary> 29 35 string ActualName { get; set; } 36 /// <summary> 37 /// Gets or sets the formal name of the current instance. 38 /// </summary> 30 39 string FormalName { get; } 40 /// <summary> 41 /// Gets the description of the current instance. 42 /// </summary> 31 43 string Description { get; } 44 /// <summary> 45 /// Gets the data type of the current instance. 46 /// </summary> 32 47 Type DataType { get; } 48 /// <summary> 49 /// Gets the kind of the variable info (in, out, new,...). 50 /// </summary> 33 51 VariableKind Kind { get; } 52 /// <summary> 53 /// Gets or sets a boolean value whether the current instance is a local variable info. 54 /// </summary> 34 55 bool Local { get; set; } 35 56 57 /// <summary> 58 /// Occurs when the actual name of the current instance has been changed. 59 /// </summary> 36 60 event EventHandler ActualNameChanged; 61 /// <summary> 62 /// Occurs when the local flag has been changed. 63 /// </summary> 37 64 event EventHandler LocalChanged; 38 65 } -
trunk/sources/HeuristicLab.Core/Interfaces/IView.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// An interface for all kinds visual representations of items (objects, operators...). 30 /// </summary> 28 31 public interface IView : IControl { 32 /// <summary> 33 /// Gets the current item instance. 34 /// </summary> 29 35 IItem Item { get; } 36 /// <summary> 37 /// Gets or sets the caption of the current instance. 38 /// </summary> 30 39 string Caption { get; set; } 31 40 41 /// <summary> 42 /// Occurs when the item was changed. 43 /// </summary> 32 44 event EventHandler ItemChanged; 45 /// <summary> 46 /// Occurs when the caption was changed. 47 /// </summary> 33 48 event EventHandler CaptionChanged; 34 49 } -
trunk/sources/HeuristicLab.Core/Interfaces/IViewable.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent items that can displayed visually. 29 /// </summary> 27 30 public interface IViewable { 31 /// <summary> 32 /// Creates a view to display the current instance. 33 /// </summary> 34 /// <returns>The created view.</returns> 28 35 IView CreateView(); 29 36 } -
trunk/sources/HeuristicLab.Core/Interfaces/IVisualizationItem.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Marker interface for items that can be visualized. 29 /// </summary> 27 30 public interface IVisualizationItem : IItem { } 28 31 } -
trunk/sources/HeuristicLab.Core/ItemBase.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Represents the base class for all basic item types. 30 /// </summary> 28 31 public abstract class ItemBase : StorableBase, IItem { 32 /// <summary> 33 /// Creates a new instance of <see cref="ItemBaseView"/> for 34 /// visual representation of the current instance. 35 /// </summary> 36 /// <returns>The created instance as <see cref="ItemBaseView"/>.</returns> 29 37 public virtual IView CreateView() { 30 38 return new ItemBaseView(this); 31 39 } 32 40 41 /// <summary> 42 /// Gets the string representation of the current instance. 43 /// </summary> 44 /// <returns>The type name of the current instance.</returns> 33 45 public override string ToString() { 34 46 return GetType().Name; 35 47 } 36 48 49 /// <summary> 50 /// Fires a new <c>Changed</c> event. 51 /// </summary> 52 /// <remarks>Calls <see cref="OnChanged"/>.</remarks> 37 53 public void FireChanged() { 38 54 OnChanged(); 39 55 } 40 56 57 /// <summary> 58 /// Occurs when the current item was changed. 59 /// </summary> 41 60 public event EventHandler Changed; 61 /// <summary> 62 /// Fires a new <c>Changed</c> event. 63 /// </summary> 42 64 protected virtual void OnChanged() { 43 65 if (Changed != null) -
trunk/sources/HeuristicLab.Core/ItemBaseView.cs
r2 r776 28 28 using System.Windows.Forms; 29 29 30 namespace HeuristicLab.Core { 30 namespace HeuristicLab.Core { 31 /// <summary> 32 /// The base class for visual representations of items. 33 /// </summary> 31 34 public partial class ItemBaseView : ViewBase { 35 /// <summary> 36 /// Initializes a new instance of <see cref="ItemBaseView"/>. 37 /// </summary> 32 38 public ItemBaseView() { 33 39 InitializeComponent(); 34 40 } 41 /// <summary> 42 /// Intializes a new instance of <see cref="ItemBaseView"/> with the given <paramref name="item"/>. 43 /// </summary> 44 /// <param name="item">The item that should be displayed.</param> 35 45 public ItemBaseView(IItem item) 36 46 : this() { -
trunk/sources/HeuristicLab.Core/ItemEventArgs.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Event arguments to be able to specify the affected item. 29 /// </summary> 27 30 public class ItemEventArgs : EventArgs { 28 31 private IItem myItem; 32 /// <summary> 33 /// Gets the affected item. 34 /// </summary> 29 35 public IItem Item { 30 36 get { return myItem; } 31 37 } 32 38 39 /// <summary> 40 /// Initializes a new instance of <see cref="ItemEventArgs"/> with the given <paramref name="item"/>. 41 /// </summary> 42 /// <param name="item">The affected item.</param> 33 43 public ItemEventArgs(IItem item) { 34 44 myItem = item; -
trunk/sources/HeuristicLab.Core/ItemIndexEventArgs.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Event arguments to be able to specify the affected item at a specified index. 29 /// </summary> 27 30 public class ItemIndexEventArgs : ItemEventArgs { 28 31 private int myIndex; 32 /// <summary> 33 /// Gets the affected index. 34 /// </summary> 29 35 public int Index { 30 36 get { return myIndex; } 31 37 } 32 38 39 /// <summary> 40 /// Initializes a new instance of <see cref="ItemIndexEventArgs"/> with the given <paramref name="item"/> 41 /// and the given <paramref name="index"/>. 42 /// </summary> 43 /// <remarks>Calls constructor of base class <see cref="ItemEventArgs"/>.</remarks> 44 /// <param name="item">The affected item.</param> 45 /// <param name="index">The affected index.</param> 33 46 public ItemIndexEventArgs(IItem item, int index) 34 47 : base(item) { -
trunk/sources/HeuristicLab.Core/KeyValueEventArgs.cs
r187 r776 4 4 5 5 namespace HeuristicLab.Core { 6 /// <summary> 7 /// Event arguments to be able to specify the affected key-value pair. 8 /// </summary> 6 9 public class KeyValueEventArgs : EventArgs { 7 10 8 11 private IItem key; 12 /// <summary> 13 /// Gets the affected key. 14 /// </summary> 9 15 public IItem Key { 10 16 get { return key; } … … 12 18 13 19 private IItem value; 20 /// <summary> 21 /// Gets the affected value. 22 /// </summary> 14 23 public IItem Value { 15 24 get { return value; } 16 25 } 17 26 27 /// <summary> 28 /// Initializes a new instance of <see cref="KeyValueEventArgs"/> with the given <paramref name="key"/> 29 /// and <paramref name="value"/>. 30 /// </summary> 31 /// <param name="key">The affected key.</param> 32 /// <param name="value">The affected value.</param> 18 33 public KeyValueEventArgs(IItem key, IItem value) { 19 34 this.key = key; -
trunk/sources/HeuristicLab.Core/NameChangingEventArgs.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Event arguments to be able to specify the affected name. 30 /// </summary> 28 31 public class NameChangingEventArgs : CancelEventArgs { 29 32 private string myName; 33 /// <summary> 34 /// Gets the affected name. 35 /// </summary> 30 36 public string Name { 31 37 get { return myName; } 32 38 } 33 39 40 /// <summary> 41 /// Initializes a new instance of <see cref="NameChangingEventArgs"/> 42 /// with the specified <paramref name="name"/>. 43 /// </summary> 44 /// <param name="name">The affected name.</param> 34 45 public NameChangingEventArgs(string name) 35 46 : base() { 36 47 myName = name; 37 48 } 49 /// <summary> 50 /// Initializes a new instance of <see cref="NameChangingEventArgs"/> 51 /// with the specified <paramref name="name"/> and a flag whether the event has been canceled. 52 /// </summary> 53 /// <remarks>Calls constructor of base class <see cref="CancelEventArgs"/>.</remarks> 54 /// <param name="name">The affected name.</param> 55 /// <param name="cancel">Flag, whether the event has been canceled.</param> 38 56 public NameChangingEventArgs(string name, bool cancel) 39 57 : base(cancel) { -
trunk/sources/HeuristicLab.Core/OperationEventArgs.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Event arguments to be able to specify the affected operation. 29 /// </summary> 27 30 public class OperationEventArgs : EventArgs { 28 31 private IOperation myOperation; 32 /// <summary> 33 /// Gets the affected operation. 34 /// </summary> 29 35 public IOperation Operation { 30 36 get { return myOperation; } 31 37 } 32 38 39 /// <summary> 40 /// Initializes a new instance of <see cref="OperationEventArgs"/> with the given 41 /// <paramref name="operation"/>. 42 /// </summary> 43 /// <param name="operation">The affected operation.</param> 33 44 public OperationEventArgs(IOperation operation) { 34 45 myOperation = operation; -
trunk/sources/HeuristicLab.Core/OperatorBase.cs
r76 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// The base class for all operators. 30 /// </summary> 28 31 public abstract class OperatorBase : ConstrainedItemBase, IOperator { 29 32 private string myName; 33 /// <summary> 34 /// Gets or sets the name of the operator. 35 /// </summary> 36 /// <remarks>Calls <see cref="OnNameChanged"/> in the setter.</remarks> 30 37 public string Name { 31 38 get { return myName; } … … 37 44 } 38 45 } 46 /// <summary> 47 /// Gets the description of the current operator. 48 /// </summary> 49 /// <remarks>Returns "No operator description available" if the method is not overriden.</remarks> 39 50 public virtual string Description { 40 51 get { return "No operator description available."; } 41 52 } 42 53 /// <summary> 54 /// Flag whether the current instance has been canceled. 55 /// </summary> 43 56 protected bool myCanceled; 57 /// <inheritdoc/> 44 58 public bool Canceled { 45 59 get { return myCanceled; } 46 60 } 47 61 private bool myBreakpoint; 62 /// <inheritdoc/> 63 /// <remarks>Calls <see cref="OnBreakpointChanged"/> in the setter.</remarks> 48 64 public bool Breakpoint { 49 65 get { return myBreakpoint; } … … 57 73 58 74 private List<IOperator> mySubOperators; 75 /// <summary> 76 /// Gets a list of all suboperators. 77 /// <note type="caution"> Returns the suboperators read-only!</note> 78 /// </summary> 59 79 public virtual IList<IOperator> SubOperators { 60 80 get { return mySubOperators.AsReadOnly(); } 61 81 } 62 82 private Dictionary<string, IVariableInfo> myVariableInfos; 83 /// <inheritdoc/> 63 84 public virtual ICollection<IVariableInfo> VariableInfos { 64 85 get { return myVariableInfos.Values; } 65 86 } 66 87 private Dictionary<string, IVariable> myVariables; 88 /// <inheritdoc/> 67 89 public virtual ICollection<IVariable> Variables { 68 90 get { return myVariables.Values; } 69 91 } 70 92 93 /// <summary> 94 /// Initializes a new instance of <see cref="OperatorBase"/> setting the breakpoint flag and 95 /// the canceled flag to <c>false</c> and the name of the operator to the type name. 96 /// </summary> 71 97 protected OperatorBase() { 72 98 myName = this.GetType().Name; … … 78 104 } 79 105 106 /// <summary> 107 /// Clones the current instance (deep clone). 108 /// </summary> 109 /// <remarks>Clones also sub operators, variables and variable infos.</remarks> 110 /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param> 111 /// <returns>The cloned object as <see cref="OperatorBase"/>.</returns> 80 112 public override object Clone(IDictionary<Guid, object> clonedObjects) { 81 113 OperatorBase clone = (OperatorBase)base.Clone(clonedObjects); … … 93 125 } 94 126 127 /// <summary> 128 /// Creates a new instance of <see cref="OperatorBaseView"/> to represent the current operator 129 /// visually. 130 /// </summary> 131 /// <returns>The created view as <see cref="OperatorBaseView"/>.</returns> 95 132 public override IView CreateView() { 96 133 return new OperatorBaseView(this); … … 98 135 99 136 #region SubOperator Methods 137 /// <inheritdoc cref="HeuristicLab.Core.IOperator.AddSubOperator(HeuristicLab.Core.IOperator)"/> 138 /// <param name="subOperator">The sub operator to add.</param> 139 /// <remarks>Calls <see cref="OnSubOperatorAdded"/>.</remarks> 100 140 public virtual void AddSubOperator(IOperator subOperator) { 101 141 mySubOperators.Add(subOperator); 102 142 OnSubOperatorAdded(subOperator, mySubOperators.Count - 1); 103 143 } 144 /// <inheritdoc cref="IOperator.TryAddSubOperator(HeuristicLab.Core.IOperator)"/> 145 /// <param name="subOperator">The sub operator to add.</param> 146 /// <remarks>Calls <see cref="OnSubOperatorAdded"/>.</remarks> 104 147 public virtual bool TryAddSubOperator(IOperator subOperator) { 105 148 mySubOperators.Add(subOperator); … … 112 155 } 113 156 } 157 /// <inheritdoc cref="HeuristicLab.Core.IOperator.TryAddSubOperator(HeuristicLab.Core.IOperator, 158 /// out System.Collections.Generic.ICollection<HeuristicLab.Core.IConstraint>)"/> 159 /// <param name="subOperator">The sub operator to add.</param> 160 /// <remarks>Calls <see cref="OnSubOperatorAdded"/>.</remarks> 114 161 public virtual bool TryAddSubOperator(IOperator subOperator, out ICollection<IConstraint> violatedConstraints) { 115 162 mySubOperators.Add(subOperator); … … 122 169 } 123 170 } 171 /// <inheritdoc cref="HeuristicLab.Core.IOperator.AddSubOperator(HeuristicLab.Core.IOperator, int)"/> 172 /// <param name="subOperator">The sub operator to add.</param> 173 /// <remarks>Calls <see cref="OnSubOperatorAdded"/>.</remarks> 124 174 public virtual void AddSubOperator(IOperator subOperator, int index) { 125 175 mySubOperators.Insert(index, subOperator); 126 176 OnSubOperatorAdded(subOperator, index); 127 177 } 178 /// <inheritdoc cref="IOperator.TryAddSubOperator(HeuristicLab.Core.IOperator, int)"/> 179 /// <param name="subOperator">The sub operator to add.</param> 180 /// <remarks>Calls <see cref="OnSubOperatorAdded"/>.</remarks> 128 181 public virtual bool TryAddSubOperator(IOperator subOperator, int index) { 129 182 mySubOperators.Insert(index, subOperator); … … 136 189 } 137 190 } 191 /// <inheritdoc cref="IOperator.TryAddSubOperator(HeuristicLab.Core.IOperator, int, out 192 /// System.Collections.Generic.ICollection<HeuristicLab.Core.IConstraint>)"/> 193 /// <param name="subOperator">The sub operator to add.</param> 194 /// <remarks>Calls <see cref="OnSubOperatorAdded"/>.</remarks> 138 195 public virtual bool TryAddSubOperator(IOperator subOperator, int index, out ICollection<IConstraint> violatedConstraints) { 139 196 mySubOperators.Insert(index, subOperator); … … 146 203 } 147 204 } 205 /// <inheritdoc/> 206 /// <remarks>Calls <see cref="OnSubOperatorRemoved"/>.</remarks> 148 207 public virtual void RemoveSubOperator(int index) { 149 208 IOperator op = mySubOperators[index]; … … 151 210 OnSubOperatorRemoved(op, index); 152 211 } 212 /// <inheritdoc/> 213 /// <remarks>Calls <see cref="OnSubOperatorRemoved"/>.</remarks> 153 214 public virtual bool TryRemoveSubOperator(int index) { 154 215 IOperator op = mySubOperators[index]; … … 162 223 } 163 224 } 225 /// <inheritdoc/> 226 /// <remarks>Calls <see cref="OnSubOperatorRemoved"/>.</remarks> 164 227 public virtual bool TryRemoveSubOperator(int index, out ICollection<IConstraint> violatedConstraints) { 165 228 IOperator op = mySubOperators[index]; … … 176 239 177 240 #region VariableInfo Methods 241 /// <inheritdoc/> 178 242 public virtual IVariableInfo GetVariableInfo(string formalName) { 179 243 IVariableInfo info; … … 183 247 return null; 184 248 } 249 /// <inheritdoc/> 250 /// <remarks>Calls <see cref="OnVariableInfoAdded"/>.</remarks> 185 251 public virtual void AddVariableInfo(IVariableInfo variableInfo) { 186 252 myVariableInfos.Add(variableInfo.FormalName, variableInfo); 187 253 OnVariableInfoAdded(variableInfo); 188 254 } 255 /// <inheritdoc/> 256 /// <remarks>Calls <see cref="OnVariableInfoAdded"/>.</remarks> 189 257 public virtual bool TryAddVariableInfo(IVariableInfo variableInfo) { 190 258 myVariableInfos.Add(variableInfo.FormalName, variableInfo); … … 197 265 } 198 266 } 267 /// <inheritdoc/> 268 /// <remarks>Calls <see cref="OnVariableInfoAdded"/>.</remarks> 199 269 public virtual bool TryAddVariableInfo(IVariableInfo variableInfo, out ICollection<IConstraint> violatedConstraints) { 200 270 myVariableInfos.Add(variableInfo.FormalName, variableInfo); … … 207 277 } 208 278 } 279 /// <inheritdoc/> 280 /// <remarks>Calls <see cref="OnVariableInfoRemoved"/>.</remarks> 209 281 public virtual void RemoveVariableInfo(string formalName) { 210 282 IVariableInfo variableInfo; … … 214 286 } 215 287 } 288 /// <inheritdoc/> 289 /// <remarks>Calls <see cref="OnVariableInfoRemoved"/>.</remarks> 216 290 public virtual bool TryRemoveVariableInfo(string formalName) { 217 291 IVariableInfo variableInfo; … … 228 302 return true; 229 303 } 304 /// <inheritdoc/> 305 /// <remarks>Calls <see cref="OnVariableInfoRemoved"/>.</remarks> 230 306 public virtual bool TryRemoveVariableInfo(string formalName, out ICollection<IConstraint> violatedConstraints) { 231 307 IVariableInfo variableInfo; … … 246 322 247 323 #region Variable Methods 324 /// <inheritdoc/> 248 325 public virtual IVariable GetVariable(string name) { 249 326 IVariable variable; … … 253 330 return null; 254 331 } 332 /// <inheritdoc/> 333 /// <remarks>Calls <see cref="OnVariableAdded"/> and adds <c>NameChanging</c> and <c>NameChanged</c> 334 /// event handlers.</remarks> 255 335 public virtual void AddVariable(IVariable variable) { 256 336 myVariables.Add(variable.Name, variable); … … 259 339 OnVariableAdded(variable); 260 340 } 341 /// <inheritdoc/> 342 /// <remarks>Calls <see cref="OnVariableAdded"/> and adds <c>NameChanging</c> and <c>NameChanged</c> 343 /// event handlers.</remarks> 261 344 public virtual bool TryAddVariable(IVariable variable) { 262 345 myVariables.Add(variable.Name, variable); … … 271 354 } 272 355 } 356 /// <inheritdoc/> 357 /// <remarks>Calls <see cref="OnVariableAdded"/> and adds <c>NameChanging</c> and <c>NameChanged</c> 358 /// event handlers.</remarks> 273 359 public virtual bool TryAddVariable(IVariable variable, out ICollection<IConstraint> violatedConstraints) { 274 360 myVariables.Add(variable.Name, variable); … … 283 369 } 284 370 } 371 /// <inheritdoc/> 372 /// <remarks>Calls <see cref="OnVariableRemoved"/> and removes <c>NameChanging</c> and <c>NameChanged</c> 373 /// event handlers.</remarks> 285 374 public virtual void RemoveVariable(string name) { 286 375 IVariable variable; … … 292 381 } 293 382 } 383 /// <inheritdoc/> 384 /// <remarks>Calls <see cref="OnVariableRemoved"/> and removes <c>NameChanging</c> and <c>NameChanged</c> 385 /// event handlers.</remarks> 294 386 public virtual bool TryRemoveVariable(string name) { 295 387 IVariable variable; … … 308 400 return true; 309 401 } 402 /// <inheritdoc/> 403 /// <remarks>Calls <see cref="OnVariableRemoved"/> and removes <c>NameChanging</c> and <c>NameChanged</c> 404 /// event handlers.</remarks> 310 405 public virtual bool TryRemoveVariable(string name, out ICollection<IConstraint> violatedConstraints) { 311 406 IVariable variable; … … 338 433 myVariables.Add(variable.Name, variable); 339 434 } 435 /// <inheritdoc cref="IOperator.GetVariableValue<T>(string, HeuristicLab.Core.IScope, bool)"/> 436 /// <remarks>Calls <see cref="GetVariableValue<T>(string, HeuristicLab.Core.IScope, bool, bool)"/> 437 /// with <c>throwOnError</c> set to <c>false</c>.</remarks> 340 438 public T GetVariableValue<T>(string formalName, IScope scope, bool recursiveLookup) where T : class, IItem { 341 439 return GetVariableValue<T>(formalName, scope, recursiveLookup, true); 342 440 } 441 /// <inheritdoc cref="IOperator.GetVariableValue<T>(string, HeuristicLab.Core.IScope, bool, bool)"/> 442 /// <remarks>Calls 443 /// <see cref="GetVariableValue(string, HeuristicLab.Core.IScope, bool, bool)"/>.</remarks> 343 444 public T GetVariableValue<T>(string formalName, IScope scope, bool recursiveLookup, bool throwOnError) where T : class, IItem { 344 445 return (T)GetVariableValue(formalName, scope, recursiveLookup, throwOnError); 345 446 } 447 /// <inheritdoc cref="IOperator.GetVariableValue(string, HeuristicLab.Core.IScope, bool)"/> 448 /// <remarks>Calls <see cref="GetVariableValue(string, HeuristicLab.Core.IScope, bool, bool)"/> 449 /// with <c>throwOnError</c> set to <c>false</c>.</remarks> 346 450 public IItem GetVariableValue(string formalName, IScope scope, bool recursiveLookup) { 347 451 return GetVariableValue(formalName, scope, recursiveLookup, true); 348 452 } 453 /// <inheritdoc cref="IOperator.GetVariableValue(string, HeuristicLab.Core.IScope, bool, bool)"/> 349 454 public virtual IItem GetVariableValue(string formalName, IScope scope, bool recursiveLookup, bool throwOnError) { 350 455 IVariableInfo info = GetVariableInfo(formalName); … … 364 469 } 365 470 #endregion 366 471 /// <inheritdoc/> 367 472 public virtual IOperation Execute(IScope scope) { 368 473 myCanceled = false; … … 379 484 return next; 380 485 } 486 /// <inheritdoc/> 487 /// <remarks>Sets property <see cref="Canceled"/> to <c>true</c>.</remarks> 381 488 public virtual void Abort() { 382 489 myCanceled = true; 383 490 } 384 491 /// <summary> 492 /// Performs the current operator on the specified <paramref name="scope"/>. 493 /// </summary> 494 /// <param name="scope">The scope where to execute the operator</param> 495 /// <returns><c>null</c>.</returns> 385 496 public virtual IOperation Apply(IScope scope) { 386 497 return null; 387 498 } 388 499 /// <inheritdoc/> 389 500 public event EventHandler NameChanged; 501 /// <summary> 502 /// Fires a new <c>NameChanged</c> event. 503 /// </summary> 390 504 protected virtual void OnNameChanged() { 391 505 if (NameChanged != null) { … … 393 507 } 394 508 } 509 /// <inheritdoc/> 395 510 public event EventHandler BreakpointChanged; 511 /// <summary> 512 /// Fires a new <c>BreakpointChanged</c> event. 513 /// </summary> 396 514 protected virtual void OnBreakpointChanged() { 397 515 if (BreakpointChanged != null) { … … 399 517 } 400 518 } 519 /// <inheritdoc/> 401 520 public event EventHandler<OperatorIndexEventArgs> SubOperatorAdded; 521 /// <summary> 522 /// Fires a new <c>SubOperatorAdded</c> event. 523 /// </summary> 524 /// <param name="subOperator">The sub operator that has been added.</param> 525 /// <param name="index">The position where the operator has been added.</param> 402 526 protected virtual void OnSubOperatorAdded(IOperator subOperator, int index) { 403 527 if (SubOperatorAdded != null) 404 528 SubOperatorAdded(this, new OperatorIndexEventArgs(subOperator, index)); 405 529 } 530 /// <inheritdoc/> 406 531 public event EventHandler<OperatorIndexEventArgs> SubOperatorRemoved; 532 /// <summary> 533 /// Fires a new <c>SubOperatorRemoved</c> event. 534 /// </summary> 535 /// <param name="subOperator">The sub operator that has been removed.</param> 536 /// <param name="index">The position where the operator has been removed.</param> 407 537 protected virtual void OnSubOperatorRemoved(IOperator subOperator, int index) { 408 538 if (SubOperatorRemoved != null) 409 539 SubOperatorRemoved(this, new OperatorIndexEventArgs(subOperator, index)); 410 540 } 541 /// <inheritdoc/> 411 542 public event EventHandler<VariableInfoEventArgs> VariableInfoAdded; 543 /// <summary> 544 /// Fires a new <c>VariableInfoAdded</c> event. 545 /// </summary> 546 /// <param name="variableInfo">The variable info that has been added.</param> 412 547 protected virtual void OnVariableInfoAdded(IVariableInfo variableInfo) { 413 548 if (VariableInfoAdded != null) 414 549 VariableInfoAdded(this, new VariableInfoEventArgs(variableInfo)); 415 550 } 551 /// <inheritdoc/> 416 552 public event EventHandler<VariableInfoEventArgs> VariableInfoRemoved; 553 /// <summary> 554 /// Fires a new <c>VariableInfoRemoved</c> event. 555 /// </summary> 556 /// <param name="variableInfo">The variable info that has been removed.</param> 417 557 protected virtual void OnVariableInfoRemoved(IVariableInfo variableInfo) { 418 558 if (VariableInfoRemoved != null) 419 559 VariableInfoRemoved(this, new VariableInfoEventArgs(variableInfo)); 420 560 } 561 /// <inheritdoc/> 421 562 public event EventHandler<VariableEventArgs> VariableAdded; 563 /// <summary> 564 /// Fires a new <c>VariableAdded</c> event. 565 /// </summary> 566 /// <param name="variable">The variable that has been added.</param> 422 567 protected virtual void OnVariableAdded(IVariable variable) { 423 568 if (VariableAdded != null) 424 569 VariableAdded(this, new VariableEventArgs(variable)); 425 570 } 571 /// <inheritdoc/> 426 572 public event EventHandler<VariableEventArgs> VariableRemoved; 573 /// <summary> 574 /// Fires a new <c>VariableRemoved</c> event. 575 /// </summary> 576 /// <param name="variable">The variable that has been removed</param> 427 577 protected virtual void OnVariableRemoved(IVariable variable) { 428 578 if (VariableRemoved != null) 429 579 VariableRemoved(this, new VariableEventArgs(variable)); 430 580 } 581 /// <inheritdoc/> 431 582 public event EventHandler Executed; 583 /// <summary> 584 /// Fires a new <c>Executed</c> event. 585 /// </summary> 432 586 protected virtual void OnExecuted() { 433 587 if (Executed != null) { … … 437 591 438 592 #region Persistence Methods 593 /// <summary> 594 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 595 /// </summary> 596 /// <remarks> 597 /// Calls <see cref="ConstrainedItemBase.GetXmlNode"/> of base class <see cref="ConstrainedItemBase"/>. 598 /// <br/>A quick overview how the single elements of the current instance are saved: 599 /// <list type="bullet"> 600 /// <item> 601 /// <term>Name: </term> 602 /// <description>Saved as an <see cref="XmlAttribute"/> with the name <c>Name</c>.</description> 603 /// </item> 604 /// <item> 605 /// <term>Breakpoint: </term> 606 /// <description>Is only saved if it set to <c>true</c>. 607 /// Saved as an <see cref="XmlAttribute"/> with the name <c>Breakpoint</c>.</description> 608 /// </item> 609 /// <item> 610 /// <term>Sub operators: </term> 611 /// <description>Saved as child node with tag name <c>SubOperators</c>. All sub operators are themselves 612 /// saved as child nodes.</description> 613 /// </item> 614 /// <item> 615 /// <term>Variable infos: </term> 616 /// <description>Saved as child node with tag name <c>VariableInfos</c>. All variable infos are themselves 617 /// saved as child nodes.</description> 618 /// </item> 619 /// <item> 620 /// <term>Variables: </term> 621 /// <description>Saved as child node with tag name <c>Variables</c>. All variables are themselves 622 /// saved as child nodes.</description> 623 /// </item> 624 /// </list> 625 /// </remarks> 626 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 627 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 628 /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param> 629 /// <returns>The saved <see cref="XmlNode"/>.</returns> 439 630 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) { 440 631 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 461 652 return node; 462 653 } 654 /// <summary> 655 /// Loads the persisted operation from the specified <paramref name="node"/>. 656 /// </summary> 657 /// <remarks>Calls <see cref="ConstrainedItemBase.Populate"/> of base class 658 /// <see cref="ConstrainedItemBase"/>. 659 /// For informations how the different elements must be saved please see <see cref="GetXmlNode"/>.</remarks> 660 /// <param name="node">The <see cref="XmlNode"/> where the operation is saved.</param> 661 /// <param name="restoredObjects">A dictionary of all already restored objects. (Needed to avoid cycles.)</param> 463 662 public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 464 663 base.Populate(node, restoredObjects); -
trunk/sources/HeuristicLab.Core/OperatorBaseDescriptionView.cs
r2 r776 29 29 30 30 namespace HeuristicLab.Core { 31 /// <summary> 32 /// The visual representation of the description of operators. 33 /// </summary> 31 34 public partial class OperatorBaseDescriptionView : ViewBase { 35 /// <summary> 36 /// Gets or sets the operator whose description should be displayed. 37 /// </summary> 38 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>.</remarks> 32 39 public IOperator Operator { 33 40 get { return (IOperator)Item; } 34 41 set { base.Item = value; } 35 42 } 36 43 /// <summary> 44 /// Initializes a new instance of <see cref="OperatorBaseDescriptionView"/> with caption "Operator". 45 /// </summary> 37 46 public OperatorBaseDescriptionView() { 38 47 InitializeComponent(); 39 48 Caption = "Operator"; 40 49 } 50 /// <summary> 51 /// Initializes a new instance of <see cref="OperatorBaseDescriptionView"/> 52 /// with the operator <paramref name="op"/>. 53 /// </summary> 54 /// <remarks>Calls <see cref="OperatorBaseDescriptionView()"/>.</remarks> 55 /// <param name="op">The operator whose description to display.</param> 41 56 public OperatorBaseDescriptionView(IOperator op) 42 57 : this() { … … 44 59 } 45 60 61 /// <summary> 62 /// Updates all controls with the latest data of the model. 63 /// </summary> 64 /// <remarks>Calls <see cref="ViewBase.UpdateControls"/> of base class <see cref="ViewBase"/>.</remarks> 46 65 protected override void UpdateControls() { 47 66 base.UpdateControls(); -
trunk/sources/HeuristicLab.Core/OperatorBaseVariableInfosView.cs
r2 r776 29 29 30 30 namespace HeuristicLab.Core { 31 /// <summary> 32 /// The visual representation of the information of the variables of an operator. 33 /// </summary> 31 34 public partial class OperatorBaseVariableInfosView : ViewBase { 35 /// <summary> 36 /// Gets or sets the operator whose variable infos should be represented visually. 37 /// </summary> 38 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 39 /// No own data storage present.</remarks> 32 40 public IOperator Operator { 33 41 get { return (IOperator)Item; } 34 42 set { base.Item = value; } 35 43 } 44 /// <summary> 45 /// Gets all selected variable infos. 46 /// <note type="caution"> Variable infos are returned read-only!</note> 47 /// </summary> 36 48 public ICollection<IVariableInfo> SelectedVariableInfos { 37 49 get { … … 43 55 } 44 56 57 /// <summary> 58 /// Initializes a new instance of <see cref="OperatorBaseVariableInfosView"/> with caption "Operator". 59 /// </summary> 45 60 public OperatorBaseVariableInfosView() { 46 61 InitializeComponent(); … … 48 63 Caption = "Operator"; 49 64 } 65 /// <summary> 66 /// Initializes a new instance of <see cref="OperatorBaseVariableInfosView"/> with the given operator 67 /// <paramref name="op"/>. 68 /// </summary> 69 /// <remarks>Calls <see cref="OperatorBaseVariableInfosView()"/>.</remarks> 70 /// <param name="op">The operator whose variable infos should be displayed.</param> 50 71 public OperatorBaseVariableInfosView(IOperator op) 51 72 : this() { … … 53 74 } 54 75 76 /// <summary> 77 /// Removes the eventhandlers from the underlying <see cref="IOperator"/>. 78 /// </summary> 79 /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 55 80 protected override void RemoveItemEvents() { 56 81 Operator.VariableInfoAdded -= new EventHandler<VariableInfoEventArgs>(OperatorBase_VariableInfoAdded); … … 58 83 base.RemoveItemEvents(); 59 84 } 85 /// <summary> 86 /// Adds eventhandlers to the underlying <see cref="IOperator"/>. 87 /// </summary> 88 /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 60 89 protected override void AddItemEvents() { 61 90 base.AddItemEvents(); … … 64 93 } 65 94 95 /// <summary> 96 /// Updates all controls with the latest data of the model. 97 /// </summary> 98 /// <remarks>Calls <see cref="ViewBase.UpdateControls"/> of base class <see cref="ViewBase"/>.</remarks> 66 99 protected override void UpdateControls() { 67 100 base.UpdateControls(); … … 105 138 } 106 139 140 /// <summary> 141 /// Occurs when the variables were changed, whose infos should be displayed. 142 /// </summary> 107 143 public event EventHandler SelectedVariableInfosChanged; 144 /// <summary> 145 /// Fires a new <c>SelectedVariableInfosChanged</c>. 146 /// </summary> 108 147 protected virtual void OnSelectedVariableInfosChanged() { 109 148 if (SelectedVariableInfosChanged != null) -
trunk/sources/HeuristicLab.Core/OperatorBaseVariablesView.cs
r2 r776 29 29 30 30 namespace HeuristicLab.Core { 31 /// <summary> 32 /// The visual representation of the variables of an operator. 33 /// </summary> 31 34 public partial class OperatorBaseVariablesView : ViewBase { 32 35 private ChooseItemDialog chooseItemDialog; 33 36 37 /// <summary> 38 /// Gets or sets the operator whose variables to represent. 39 /// </summary> 40 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 41 /// No own data storage present.</remarks> 34 42 public IOperator Operator { 35 43 get { return (IOperator)Item; } … … 37 45 } 38 46 47 /// <summary> 48 /// Initializes a new instance of <see cref="OperatorBaseVariablesView"/> with caption "Operator". 49 /// </summary> 39 50 public OperatorBaseVariablesView() { 40 51 InitializeComponent(); … … 42 53 Caption = "Operator"; 43 54 } 55 /// <summary> 56 /// Initializes a new instance of <see cref="OperatorBaseVariablesView"/> with the given 57 /// operator <paramref name="op"/>. 58 /// </summary> 59 /// <remarks>Calls <see cref="OperatorBaseVariablesView"/>.</remarks> 60 /// <param name="op">The operator whose variables should be represented visually.</param> 44 61 public OperatorBaseVariablesView(IOperator op) 45 62 : this() { … … 47 64 } 48 65 66 /// <summary> 67 /// Removes the eventhandlers from the unterlying <see cref="IOperator"/>. 68 /// </summary> 69 /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 49 70 protected override void RemoveItemEvents() { 50 71 Operator.VariableAdded -= new EventHandler<VariableEventArgs>(OperatorBase_VariableAdded); … … 52 73 base.RemoveItemEvents(); 53 74 } 75 /// <summary> 76 /// Adds eventhandlers to the underlying <see cref="IOperator"/>. 77 /// </summary> 78 /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 54 79 protected override void AddItemEvents() { 55 80 base.AddItemEvents(); … … 58 83 } 59 84 85 /// <summary> 86 /// Updates all controls with the latest data of the model. 87 /// </summary> 88 /// <remarks>Calls <see cref="ViewBase.UpdateControls"/> of base class <see cref="ViewBase"/>.</remarks> 60 89 protected override void UpdateControls() { 61 90 base.UpdateControls(); -
trunk/sources/HeuristicLab.Core/OperatorBaseView.cs
r2 r776 29 29 30 30 namespace HeuristicLab.Core { 31 /// <summary> 32 /// The base class for visual representation of operators (contains description view, variable view, 33 /// variable info view,...). 34 /// </summary> 31 35 public partial class OperatorBaseView : ViewBase { 36 /// <summary> 37 /// Gets or sets the operator to represent visually. 38 /// </summary> 39 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 40 /// No own data storage present.</remarks> 32 41 public IOperator Operator { 33 42 get { return (IOperator)Item; } … … 35 44 } 36 45 46 /// <summary> 47 /// Initializes a new instance of <see cref="OperatorBaseView"/> with caption "Operator". 48 /// </summary> 37 49 public OperatorBaseView() { 38 50 InitializeComponent(); 39 51 Caption = "Operator"; 40 52 } 53 /// <summary> 54 /// Initializes a new instance of <see cref="OperatorBaseView"/> 55 /// with the given operator <paramref name="op"/>. 56 /// </summary> 57 /// <remarks>Calls <see cref="OperatorBaseView()"/>.</remarks> 58 /// <param name="op">The operator to represent visually.</param> 41 59 public OperatorBaseView(IOperator op) 42 60 : this() { … … 44 62 } 45 63 64 /// <summary> 65 /// Removes event handlers in all children. 66 /// </summary> 46 67 protected override void RemoveItemEvents() { 47 68 operatorBaseVariableInfosView.Operator = null; … … 51 72 base.RemoveItemEvents(); 52 73 } 74 /// <summary> 75 /// Adds event handlers in all children. 76 /// </summary> 53 77 protected override void AddItemEvents() { 54 78 base.AddItemEvents(); … … 59 83 } 60 84 85 /// <summary> 86 /// Updates all controls with the latest data of the model. 87 /// </summary> 88 /// <remarks>Calls <see cref="ViewBase.UpdateControls"/> of base class <see cref="ViewBase"/>.</remarks> 61 89 protected override void UpdateControls() { 62 90 base.UpdateControls(); -
trunk/sources/HeuristicLab.Core/OperatorEventArgs.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Event arguments to be able to specify the affected operator. 29 /// </summary> 27 30 public class OperatorEventArgs : ItemEventArgs { 31 /// <summary> 32 /// Gets the affected operator. 33 /// </summary> 34 /// <remarks>Uses property <see cref="ItemEventArgs.Item"/> of base class <see cref="ItemEventArgs"/>. 35 /// No own data storage present.</remarks> 28 36 public IOperator Operator { 29 37 get { return (IOperator)Item; } 30 38 } 31 39 40 /// <summary> 41 /// Initializes a new instance of <see cref="OperatorEventArgs"/> with the specified operator. 42 /// </summary> 43 /// <remarks>Calls constructor of base class <see cref="ItemEventArgs"/>.</remarks> 44 /// <param name="op">The affected operator.</param> 32 45 public OperatorEventArgs(IOperator op) 33 46 : base(op) { -
trunk/sources/HeuristicLab.Core/OperatorGraph.cs
r47 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Represents a graph of operators. 30 /// </summary> 28 31 public class OperatorGraph : ItemBase, IOperatorGraph { 29 32 private IDictionary<Guid, IOperator> myOperators; 33 /// <summary> 34 /// Gets all operators of the current instance. 35 /// </summary> 30 36 public ICollection<IOperator> Operators { 31 37 get { return myOperators.Values; } 32 38 } 33 39 private IOperator myInitialOperator; 40 /// <summary> 41 /// Gets or sets the initial operator (the starting one). 42 /// </summary> 43 /// <remarks>Calls <see cref="OnInitialOperatorChanged"/> in the setter.</remarks> 34 44 public IOperator InitialOperator { 35 45 get { return myInitialOperator; } … … 42 52 } 43 53 54 /// <summary> 55 /// Initializes a new instance of <see cref="OperatorGraph"/>. 56 /// </summary> 44 57 public OperatorGraph() { 45 58 myOperators = new Dictionary<Guid, IOperator>(); 46 59 } 47 60 61 /// <summary> 62 /// Creates a new instance of <see cref="OperatorGraphView"/> to represent the current instance 63 /// visually. 64 /// </summary> 65 /// <returns>The created view as <see cref="OperatorGraphView"/>.</returns> 48 66 public override IView CreateView() { 49 67 return new OperatorGraphView(this); 50 68 } 51 69 70 /// <summary> 71 /// Clones the current instance (deep clone). 72 /// </summary> 73 /// <remarks>Deep clone through <see cref="Auxiliary.Clone"/> method of helper class 74 /// <see cref="Auxiliary"/>.</remarks> 75 /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param> 76 /// <returns>The cloned object as <see cref="OperatorGraph"/>.</returns> 52 77 public override object Clone(IDictionary<Guid, object> clonedObjects) { 53 78 OperatorGraph clone = new OperatorGraph(); … … 60 85 } 61 86 87 /// <inheritdoc/> 88 /// <remarks>Calls <see cref="OnOperatorAdded"/>.</remarks> 62 89 public void AddOperator(IOperator op) { 63 90 if (!myOperators.ContainsKey(op.Guid)) { … … 69 96 } 70 97 } 98 /// <inheritdoc/> 99 /// <remarks>Calls <see cref="OnOperatorRemoved"/>.</remarks> 71 100 public void RemoveOperator(Guid guid) { 72 101 IOperator op = GetOperator(guid); … … 87 116 } 88 117 } 118 /// <inheritdoc/> 89 119 public IOperator GetOperator(Guid guid) { 90 120 IOperator op; … … 94 124 return null; 95 125 } 126 /// <inheritdoc/> 96 127 public void Clear() { 97 128 Guid[] guids = new Guid[Operators.Count]; … … 105 136 } 106 137 138 /// <inheritdoc/> 107 139 public event EventHandler<OperatorEventArgs> OperatorAdded; 140 /// <summary> 141 /// Fires a new <c>OperatorAdded</c> event. 142 /// </summary> 143 /// <param name="op">The operator that has been added.</param> 108 144 protected virtual void OnOperatorAdded(IOperator op) { 109 145 if (OperatorAdded != null) 110 146 OperatorAdded(this, new OperatorEventArgs(op)); 111 147 } 148 /// <inheritdoc/> 112 149 public event EventHandler<OperatorEventArgs> OperatorRemoved; 150 /// <summary> 151 /// Fires a new <c>OperatorRemoved</c> event. 152 /// </summary> 153 /// <param name="op">The operator that has been removed.</param> 113 154 protected virtual void OnOperatorRemoved(IOperator op) { 114 155 if (OperatorRemoved != null) 115 156 OperatorRemoved(this, new OperatorEventArgs(op)); 116 157 } 158 /// <inheritdoc/> 117 159 public event EventHandler InitialOperatorChanged; 160 /// <summary> 161 /// Fires a new <c>InitialOperatorChanged</c> event. 162 /// </summary> 118 163 protected virtual void OnInitialOperatorChanged() { 119 164 if (InitialOperatorChanged != null) … … 122 167 123 168 #region Persistence Methods 169 /// <summary> 170 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 171 /// </summary> 172 /// <remarks>Calls <see cref="StorableBase.GetXmlNode"/> of base class <see cref="ItemBase"/>.<br/> 173 /// To save the operators of the current instance a child node is created with the tag name 174 /// <c>Operators</c>. Beyond this child node all operators are saved as child nodes themselves.<br/> 175 /// The initial operator is saved as child node with the tag name <c>InitialOperator</c>.</remarks> 176 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 177 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 178 /// <param name="persistedObjects">The dictionary of all already persisted objects. 179 /// (Needed to avoid cycles.)</param> 180 /// <returns>The saved <see cref="XmlNode"/>.</returns> 124 181 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) { 125 182 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 132 189 return node; 133 190 } 191 /// <summary> 192 /// Loads the persisted operator graph from the specified <paramref name="node"/>. 193 /// </summary> 194 /// <remarks>See <see cref="GetXmlNode"/> to get more information about how the graph must be saved. <br/> 195 /// Calls <see cref="StorableBase.Populate"/> of base class <see cref="ItemBase"/>.</remarks> 196 /// <param name="node">The <see cref="XmlNode"/> where the operator graph is saved.</param> 197 /// <param name="restoredObjects">The dictionary of all already restored objects. 198 /// (Needed to avoid cycles.)</param> 134 199 public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 135 200 base.Populate(node, restoredObjects); -
trunk/sources/HeuristicLab.Core/OperatorGraphView.cs
r2 r776 30 30 31 31 namespace HeuristicLab.Core { 32 /// <summary> 33 /// The visual representation of an <see cref="IOperatorGraph"/>. 34 /// </summary> 32 35 public partial class OperatorGraphView : ViewBase { 33 36 private ChooseOperatorDialog chooseOperatorDialog; 34 37 private Dictionary<IOperator, IList<TreeNode>> operatorNodeTable; 35 38 39 /// <summary> 40 /// Gets or sets the operator graph to represent visually. 41 /// </summary> 42 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 43 /// No own data storage present.</remarks> 36 44 public IOperatorGraph OperatorGraph { 37 45 get { return (IOperatorGraph)Item; } … … 39 47 } 40 48 49 /// <summary> 50 /// Initializes a new instance of <see cref="OperatorGraphView"/> with caption "Operator Graph". 51 /// </summary> 41 52 public OperatorGraphView() { 42 53 InitializeComponent(); … … 45 56 Caption = "Operator Graph"; 46 57 } 58 /// <summary> 59 /// Initializes a new instance of <see cref="OperatorGraphView"/> 60 /// with the given <paramref name="operatorGraph"/>. 61 /// </summary> 62 /// <remarks>Calls <see cref="OperatorGraphView()"/>.</remarks> 63 /// <param name="operatorGraph">The operator graph to represent visually.</param> 47 64 public OperatorGraphView(IOperatorGraph operatorGraph) 48 65 : this() { … … 50 67 } 51 68 69 /// <summary> 70 /// Removes the eventhandlers from the underlying <see cref="IOperatorGraph"/>. 71 /// </summary> 72 /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 52 73 protected override void RemoveItemEvents() { 53 74 OperatorGraph.OperatorAdded -= new EventHandler<OperatorEventArgs>(OperatorGraph_OperatorAdded); … … 56 77 base.RemoveItemEvents(); 57 78 } 79 /// <summary> 80 /// Adds eventhandlers to the underlying <see cref="IOperatorGraph"/>. 81 /// </summary> 82 /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 58 83 protected override void AddItemEvents() { 59 84 base.AddItemEvents(); … … 63 88 } 64 89 90 /// <summary> 91 /// Updates all controls with the latest data of the model. 92 /// </summary> 93 /// <remarks>Calls <see cref="ViewBase.UpdateControls"/> of base class <see cref="ViewBase"/>.</remarks> 65 94 protected override void UpdateControls() { 66 95 base.UpdateControls(); -
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); -
trunk/sources/HeuristicLab.Core/OperatorIndexEventArgs.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Event arguments to be able to specify the affected operator at the specified index. 29 /// </summary> 27 30 public class OperatorIndexEventArgs : ItemIndexEventArgs { 31 /// <summary> 32 /// Gets the affected operator. 33 /// </summary> 34 /// <remarks>Uses property <see cref="ItemEventArgs.Item"/> of base class 35 /// <see cref="ItemIndexEventArgs"/>. No own data storage present.</remarks> 28 36 public IOperator Operator { 29 37 get { return (IOperator)Item; } 30 38 } 31 39 40 /// <summary> 41 /// Initializes a new instance of <see cref="OperatorIndexEventArgs"/> with the given operator 42 /// and the specified <paramref name="index"/>. 43 /// </summary> 44 /// <remarks>Calls constructor of base class <see cref="ItemIndexEventArgs"/>.</remarks> 45 /// <param name="op">The affected operator.</param> 46 /// <param name="index">The affected index.</param> 32 47 public OperatorIndexEventArgs(IOperator op, int index) 33 48 : base(op, index) { -
trunk/sources/HeuristicLab.Core/OperatorLibrary.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Represents a library of operators consisting of one <see cref="IOperatorGroup"/>. 30 /// </summary> 28 31 public class OperatorLibrary : ItemBase, IOperatorLibrary, IEditable { 29 32 private IOperatorGroup myGroup; 33 /// <summary> 34 /// Gets the operator group of the current instance. 35 /// </summary> 30 36 public IOperatorGroup Group { 31 37 get { return myGroup; } 32 38 } 33 39 40 /// <summary> 41 /// Initializes a new instance of <see cref="OperatorLibrary"/>. 42 /// </summary> 34 43 public OperatorLibrary() { 35 44 myGroup = new OperatorGroup(); 36 45 } 37 46 47 /// <summary> 48 /// Creates a new instance of <see cref="OperatorLibraryEditor"/> to display the current instance. 49 /// </summary> 50 /// <returns>The created view as <see cref="OperatorLibraryEditor"/>.</returns> 38 51 public override IView CreateView() { 39 52 return new OperatorLibraryEditor(this); 40 53 } 54 /// <summary> 55 /// Creates a new instance of <see cref="OperatorLibraryEditor"/> to display the current instance. 56 /// </summary> 57 /// <returns>The created editor as <see cref="OperatorLibraryEditor"/>.</returns> 41 58 public virtual IEditor CreateEditor() { 42 59 return new OperatorLibraryEditor(this); 43 60 } 44 61 62 /// <summary> 63 /// Clones the current instance (deep clone). 64 /// </summary> 65 /// <remarks>Deep clone through <see cref="Auxiliary.Clone"/> method of helper class 66 /// <see cref="Auxiliary"/>.</remarks> 67 /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param> 68 /// <returns>The cloned object as <see cref="OperatorLibrary"/>.</returns> 45 69 public override object Clone(IDictionary<Guid, object> clonedObjects) { 46 70 OperatorLibrary clone = new OperatorLibrary(); … … 51 75 52 76 #region Persistence Methods 77 /// <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> 53 87 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) { 54 88 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 56 90 return node; 57 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> 58 100 public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 59 101 base.Populate(node, restoredObjects); -
trunk/sources/HeuristicLab.Core/OperatorLibraryEditor.cs
r2 r776 31 31 32 32 namespace HeuristicLab.Core { 33 /// <summary> 34 /// Visual representation of the class <see cref="IOperatorLibrary"/>. 35 /// </summary> 33 36 public partial class OperatorLibraryEditor : EditorBase { 34 37 private ChooseOperatorDialog chooseOperatorDialog; 35 38 39 /// <summary> 40 /// Gets or sets the operator library that should be displayed. 41 /// </summary> 42 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="EditorBase"/>.</remarks> 36 43 public IOperatorLibrary OperatorLibrary { 37 44 get { return (IOperatorLibrary)Item; } … … 39 46 } 40 47 48 /// <summary> 49 /// Initializes a new instance of <see cref="OperatorLibraryEditor"/> with caption 50 /// <c>Operator Library</c>. 51 /// </summary> 41 52 public OperatorLibraryEditor() { 42 53 InitializeComponent(); … … 44 55 Caption = "Operator Library"; 45 56 } 57 /// <summary> 58 /// Initializes a new instance of <see cref="OperatorLibraryEditor"/> with the 59 /// specified <paramref name="operatorLibrary"/>. 60 /// </summary> 61 /// <param name="operatorLibrary">The operator library to display.</param> 46 62 public OperatorLibraryEditor(IOperatorLibrary operatorLibrary) 47 63 : this() { … … 61 77 } 62 78 79 /// <summary> 80 /// Updates all controls with the latest data of the model. 81 /// </summary> 82 /// <remarks>Calls <see cref="EditorBase.UpdateControls"/> of base class <see cref="EditorBase"/>.</remarks> 63 83 protected override void UpdateControls() { 64 84 base.UpdateControls(); -
trunk/sources/HeuristicLab.Core/PersistenceManager.cs
r750 r776 29 29 30 30 namespace HeuristicLab.Core { 31 /// <summary> 32 /// Static class for serializing and deserializing objects. 33 /// </summary> 31 34 public static class PersistenceManager { 35 /// <summary> 36 /// Creates an <see cref="XmlDocument"/> to persist an object with xml declaration. 37 /// </summary> 38 /// <returns>The created <see cref="XmlDocument"/>.</returns> 32 39 public static XmlDocument CreateXmlDocument() { 33 40 XmlDocument document = new XmlDocument(); … … 35 42 return document; 36 43 } 44 /// <summary> 45 /// Saves the specified <paramref name="instance"/> in the specified <paramref name="document"/> 46 /// if it has not already been serialized. 47 /// </summary> 48 /// <remarks>The tag name of the saved instance is its type name.<br/> 49 /// The guid is saved as an <see cref="XmlAttribute"/> with tag name <c>GUID</c>.</remarks> 50 /// <param name="instance">The object that should be saved.</param> 51 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 52 /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param> 53 /// <returns>The saved <see cref="XmlNode"/>.</returns> 37 54 public static XmlNode Persist(IStorable instance, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 38 55 string name = instance.GetType().Name; … … 40 57 return Persist(name, instance, document, persistedObjects); 41 58 } 59 /// <summary> 60 /// Saves the specified <paramref name="instance"/> in the specified <paramref name="document"/> 61 /// if it has not already been serialized. 62 /// </summary> 63 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 64 /// <param name="instance">The object that should be saved.</param> 65 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 66 /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param> 67 /// <returns>The saved <see cref="XmlNode"/>.</returns> 42 68 public static XmlNode Persist(string name, IStorable instance, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 43 69 if(persistedObjects.ContainsKey(instance.Guid)) { … … 53 79 } 54 80 } 55 public static IStorable Restore(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 81 /// <summary> 82 /// Loads a persisted object from the specified <paramref name="node"/>. 83 /// </summary> 84 /// <remarks>The guid is saved as an attribute with tag name <c>GUID</c>. The type of the 85 /// persisted object is saved as attribute with tag name <c>Type</c>.<br/> 86 /// Calls <c>instance.Populate</c>.</remarks> 87 /// <param name="node">The <see cref="XmlNode"/> where the object is saved.</param> 88 /// <param name="restoredObjects">A dictionary of all already restored objects. 89 /// (Needed to avoid cycles.)</param> 90 /// <returns>The loaded object.</returns> 91 public static IStorable Restore(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 56 92 Guid guid = new Guid(node.Attributes["GUID"].Value); 57 93 if(restoredObjects.ContainsKey(guid)) { … … 65 101 } 66 102 } 103 /// <summary> 104 /// Saves the specified <paramref name="instance"/> in the specified file through creating an 105 /// <see cref="XmlDocument"/>. 106 /// </summary> 107 /// <param name="instance">The object that should be saved.</param> 108 /// <param name="filename">The name of the file where the <paramref name="object"/> should be saved.</param> 67 109 public static void Save(IStorable instance, string filename) { 68 110 using(FileStream stream = File.Create(filename)) { … … 71 113 } 72 114 } 115 /// <summary> 116 /// Saves the specified <paramref name="instance"/> in the specified <paramref name="stream"/> 117 /// through creating an <see cref="XmlDocument"/>. 118 /// </summary> 119 /// <param name="instance">The object that should be saved.</param> 120 /// <param name="stream">The (file) stream where the object should be saved.</param> 73 121 public static void Save(IStorable instance, Stream stream) { 74 122 XmlDocument document = PersistenceManager.CreateXmlDocument(); … … 98 146 document.Save(stream); 99 147 } 148 /// <summary> 149 /// Loads an object from a file with the specified <paramref name="filename"/>. 150 /// </summary> 151 /// <remarks>The object must be saved as an <see cref="XmlDocument"/>. <br/> 152 /// Calls <see cref="Restore"/>.</remarks> 153 /// <param name="filename">The filename of the file where the data is saved.</param> 154 /// <returns>The loaded object.</returns> 100 155 public static IStorable Load(string filename) { 101 156 using(FileStream stream = File.OpenRead(filename)) { … … 105 160 } 106 161 } 162 /// <summary> 163 /// Loads an object from the specified <paramref name="stream"/>. 164 /// </summary> 165 /// <remarks>The object must be saved as an <see cref="XmlDocument"/>. <br/> 166 /// Calls <see cref="Restore"/>.</remarks> 167 /// <param name="stream">The stream from where to load the data.</param> 168 /// <returns>The loaded object.</returns> 107 169 public static IStorable Load(Stream stream) { 108 170 XmlDocument doc = new XmlDocument(); … … 118 180 } 119 181 182 /// <summary> 183 /// Loads an object from a zip file. 184 /// </summary> 185 /// <param name="serializedStorable">The zip file from where to load as byte array.</param> 186 /// <returns>The loaded object.</returns> 120 187 public static IStorable RestoreFromGZip(byte[] serializedStorable) { 121 188 GZipStream stream = new GZipStream(new MemoryStream(serializedStorable), CompressionMode.Decompress); … … 123 190 } 124 191 192 /// <summary> 193 /// Saves the specified <paramref name="storable"/> in a zip file. 194 /// </summary> 195 /// <remarks>Calls <see cref="Save(HeuristicLab.Core.IStorable, Stream)"/>.</remarks> 196 /// <param name="storable">The object to save.</param> 197 /// <returns>The zip stream as byte array.</returns> 125 198 public static byte[] SaveToGZip(IStorable storable) { 126 199 MemoryStream memStream = new MemoryStream(); … … 131 204 } 132 205 206 /// <summary> 207 /// Builds a meaningful string for the given <paramref name="type"/> with the namespace information, 208 /// all its arguments, the assembly name... 209 /// </summary> 210 /// <param name="type">The type for which a string should be created.</param> 211 /// <returns>A string value of this type containing different additional information.</returns> 133 212 public static string BuildTypeString(Type type) { 134 213 string assembly = type.Assembly.FullName; -
trunk/sources/HeuristicLab.Core/Scope.cs
r261 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Hierarchical container of variables (and of subscopes). 30 /// </summary> 28 31 public class Scope : ItemBase, IScope { 29 32 private IScope parent; 30 33 31 private string myName; 34 private string myName; 35 /// <summary> 36 /// Gets the name of the current scope. 37 /// </summary> 32 38 public string Name { 33 39 get { return myName; } … … 35 41 36 42 private IDictionary<string, IVariable> myVariables; 43 /// <inheritdoc/> 37 44 public ICollection<IVariable> Variables { 38 45 get { return myVariables.Values; } 39 46 } 40 47 private IDictionary<string, string> myAliases; 48 /// <inheritdoc/> 41 49 public IEnumerable<KeyValuePair<string, string>> Aliases { 42 50 get { return myAliases; } 43 51 } 44 52 private List<IScope> mySubScopes; 53 /// <summary> 54 /// Gets all subscopes of the current instance. 55 /// <note type="caution"> The subscopes are returned as read-only.</note> 56 /// </summary> 45 57 public IList<IScope> SubScopes { 46 58 get { return mySubScopes.AsReadOnly(); } 47 59 } 48 60 61 /// <summary> 62 /// Initializes a new instance of <see cref="Scope"/> having "Anonymous" as default name. 63 /// </summary> 49 64 public Scope() { 50 65 myName = "Anonymous"; … … 53 68 mySubScopes = new List<IScope>(); 54 69 } 70 /// <summary> 71 /// Initializes a new instance of <see cref="Scope"/> with the given <paramref name="name"/>. 72 /// </summary> 73 /// <param name="name">The name of the scope.</param> 55 74 public Scope(string name) 56 75 : this() { … … 58 77 } 59 78 79 /// <inheritdoc/> 60 80 public void SetParent(IScope scope) { 61 81 parent = scope; 62 82 } 63 83 84 /// <summary> 85 /// Creates a new instance of <see cref="ScopeView"/> to represent the current instance visually. 86 /// </summary> 87 /// <returns>The created view as <see cref="ScopeView"/>.</returns> 64 88 public override IView CreateView() { 65 89 return new ScopeView(this); 66 90 } 67 91 92 /// <inheritdoc/> 68 93 public IVariable GetVariable(string name) { 69 94 IVariable variable; … … 73 98 return null; 74 99 } 100 /// <inheritdoc/> 75 101 public void AddVariable(IVariable variable) { 76 102 myVariables.Add(variable.Name, variable); … … 80 106 } 81 107 108 /// <inheritdoc/> 82 109 public void RemoveVariable(string name) { 83 110 IVariable variable; … … 102 129 myVariables.Add(variable.Name, variable); 103 130 } 131 /// <inheritdoc cref="IScope.GetVariableValue<T>(string, bool)"/> 104 132 public T GetVariableValue<T>(string name, bool recursiveLookup) where T : class, IItem { 105 133 return GetVariableValue<T>(name, recursiveLookup, true); 106 134 } 135 /// <inheritdoc cref="IScope.GetVariableValue<T>(string, bool, bool)"/> 107 136 public T GetVariableValue<T>(string name, bool recursiveLookup, bool throwOnError) where T : class, IItem { 108 137 return (T)GetVariableValue(name, recursiveLookup, throwOnError); 109 138 } 139 /// <inheritdoc cref="IScope.GetVariableValue(string, bool)"/> 110 140 public IItem GetVariableValue(string name, bool recursiveLookup) { 111 141 return GetVariableValue(name, recursiveLookup, true); 112 142 } 143 /// <inheritdoc cref="IScope.GetVariableValue(string, bool, bool)"/> 113 144 public IItem GetVariableValue(string name, bool recursiveLookup, bool throwOnError) { 114 145 IVariable variable; … … 127 158 } 128 159 } 129 160 /// <inheritdoc/> 130 161 public string TranslateName(string name) { 131 162 while (myAliases.ContainsKey(name)) … … 135 166 return name; 136 167 } 168 /// <inheritdoc/> 137 169 public void AddAlias(string alias, string name) { 138 170 RemoveAlias(alias); … … 142 174 } 143 175 } 176 /// <inheritdoc/> 144 177 public void RemoveAlias(string alias) { 145 178 if (myAliases.ContainsKey(alias)) { … … 149 182 } 150 183 184 /// <inheritdoc/> 151 185 public void AddSubScope(IScope scope) { 152 186 scope.SetParent(this); … … 154 188 OnSubScopeAdded(scope, mySubScopes.Count - 1); 155 189 } 190 /// <inheritdoc/> 156 191 public void RemoveSubScope(IScope scope) { 157 192 int index = mySubScopes.IndexOf(scope); … … 161 196 } 162 197 } 198 /// <inheritdoc/> 163 199 public void ReorderSubScopes(int[] sequence) { 164 200 IScope[] scopes = mySubScopes.ToArray(); … … 168 204 OnSubScopesReordered(); 169 205 } 206 /// <inheritdoc/> 170 207 public IScope GetScope(Guid guid) { 171 208 if (Guid == guid) return this; … … 178 215 return null; 179 216 } 217 /// <inheritdoc/> 180 218 public IScope GetScope(string name) { 181 219 if (Name == name) return this; … … 189 227 } 190 228 229 /// <inheritdoc/> 191 230 public void Clear() { 192 231 string[] variableNames = new string[Variables.Count]; … … 208 247 } 209 248 249 /// <inheritdoc/> 210 250 public override object Clone(IDictionary<Guid, object> clonedObjects) { 211 251 Scope clone = (Scope)base.Clone(clonedObjects); … … 222 262 } 223 263 264 /// <inheritdoc /> 224 265 public event EventHandler<VariableEventArgs> VariableAdded; 266 /// <summary> 267 /// Fires a new <c>VariableAdded</c> event. 268 /// </summary> 269 /// <param name="variable">The variable that has been added.</param> 225 270 protected virtual void OnVariableAdded(IVariable variable) { 226 271 if (VariableAdded != null) 227 272 VariableAdded(this, new VariableEventArgs(variable)); 228 273 } 274 /// <inheritdoc /> 229 275 public event EventHandler<VariableEventArgs> VariableRemoved; 276 /// <summary> 277 /// Fires a new <c>VariableRemoved</c>. 278 /// </summary> 279 /// <param name="variable">The variable that has been deleted.</param> 230 280 protected virtual void OnVariableRemoved(IVariable variable) { 231 281 if (VariableRemoved != null) 232 282 VariableRemoved(this, new VariableEventArgs(variable)); 233 283 } 284 /// <inheritdoc /> 234 285 public event EventHandler<AliasEventArgs> AliasAdded; 286 /// <summary> 287 /// Fires a new <c>AliasAdded</c> event. 288 /// </summary> 289 /// <param name="alias">The alias that has been added.</param> 235 290 protected virtual void OnAliasAdded(string alias) { 236 291 if (AliasAdded != null) 237 292 AliasAdded(this, new AliasEventArgs(alias)); 238 293 } 294 /// <inheritdoc/> 239 295 public event EventHandler<AliasEventArgs> AliasRemoved; 296 /// <summary> 297 /// Fires a new <c>AliasRemoved</c> event. 298 /// </summary> 299 /// <param name="alias">The alias that has been deleted.</param> 240 300 protected virtual void OnAliasRemoved(string alias) { 241 301 if (AliasRemoved != null) 242 302 AliasRemoved(this, new AliasEventArgs(alias)); 243 303 } 304 /// <inheritdoc/> 244 305 public event EventHandler<ScopeIndexEventArgs> SubScopeAdded; 306 /// <summary> 307 /// Fires a new <c>SubScopeAdded</c> event. 308 /// </summary> 309 /// <param name="scope">The sub scope that has been added.</param> 310 /// <param name="index">The index where the scope has been added.</param> 245 311 protected virtual void OnSubScopeAdded(IScope scope, int index) { 246 312 if (SubScopeAdded != null) 247 313 SubScopeAdded(this, new ScopeIndexEventArgs(scope, index)); 248 314 } 315 /// <inheritdoc/> 249 316 public event EventHandler<ScopeIndexEventArgs> SubScopeRemoved; 317 /// <summary> 318 /// Fires a new <c>SubScopeRemoved</c> event. 319 /// </summary> 320 /// <param name="scope">The sub scope that has been deleted.</param> 321 /// <param name="index">The position of the sub scope.</param> 250 322 protected virtual void OnSubScopeRemoved(IScope scope, int index) { 251 323 if (SubScopeRemoved != null) 252 324 SubScopeRemoved(this, new ScopeIndexEventArgs(scope, index)); 253 325 } 326 /// <inheritdoc /> 254 327 public event EventHandler SubScopesReordered; 328 /// <summary> 329 /// Fires a new <c>SubScopesReordered</c> event 330 /// </summary> 255 331 protected virtual void OnSubScopesReordered() { 256 332 if (SubScopesReordered != null) … … 259 335 260 336 #region Persistence Methods 337 /// <summary> 338 /// Saves the current instance as <see cref="XmlNode"/> in the given <paramref name="document"/>. 339 /// </summary> 340 /// <remarks> 341 /// Calls <see cref="StorableBase.GetXmlNode"/> of base class <see cref="ItemBase"/>.<br/> 342 /// A quick overview how the single elements of the current instance are saved: 343 /// <list type="bullet"> 344 /// <item> 345 /// <term>Name: </term> 346 /// <description>Saved as an <see cref="XmlAttribute"/> having the tag name <c>Name</c>.</description> 347 /// </item> 348 /// <item> 349 /// <term>Variables: </term> 350 /// <description>A child node is created with the tag name <c>Variables</c>. Beyond this child node, 351 /// all variables are saved as child nodes.</description> 352 /// </item> 353 /// <item> 354 /// <term>Aliases: </term> 355 /// <description>A child node is created with the tag name <c>Aliases</c>. Beyond this child node, 356 /// all aliases are saved as child nodes with the tag name <c>Alias</c>. Each alias has an 357 /// <see cref="XmlAttribute"/> with the tag name "Alias", holding the alias, and an attribute 358 /// with the tag name <c>Name</c>, holding the name of the alias.</description> 359 /// </item> 360 /// <item> 361 /// <term>Sub scopes: </term> 362 /// <description>A child node is created with the tag name <c>SubScopes</c>. Beyond this child node, 363 /// all sub scopes are saved as child nodes.</description> 364 /// </item> 365 /// </list> 366 /// </remarks> 367 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 368 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 369 /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param> 370 /// <returns>The saved <see cref="XmlNode"/>.</returns> 261 371 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) { 262 372 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 290 400 return node; 291 401 } 402 /// <summary> 403 /// Loads the persisted scope from the specified <paramref name="node"/>. 404 /// </summary> 405 /// <remarks>See <see cref="GetXmlNode"/> to get further information on how the current instance must 406 /// be saved. <br/> 407 /// Calls <see cref="StorableBase.Populate"/> of base class <see cref="ItemBase"/>.</remarks> 408 /// <param name="node">The <see cref="XmlNode"/> where the boolean value is saved.</param> 409 /// <param name="restoredObjects">The dictionary of all already restored objects. 410 /// (Needed to avoid cycles.)</param> 292 411 public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 293 412 base.Populate(node, restoredObjects); -
trunk/sources/HeuristicLab.Core/ScopeEventArgs.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Event arguments to be able to specify the affected scope. 29 /// </summary> 27 30 public class ScopeEventArgs : ItemEventArgs { 31 /// <summary> 32 /// Gets the affected scope. 33 /// </summary> 34 /// <remarks>Uses property <see cref="ItemEventArgs.Item"/> of base class <see cref="ItemEventArgs"/>. 35 /// No own data storage present.</remarks> 28 36 public IScope Scope { 29 37 get { return (IScope)Item; } 30 38 } 31 39 40 /// <summary> 41 /// Initializes a new instance of <see cref="ScopeEventArgs"/> with the specified scope. 42 /// </summary> 43 /// <param name="scope">The affected scope.</param> 32 44 public ScopeEventArgs(IScope scope) 33 45 : base(scope) { -
trunk/sources/HeuristicLab.Core/ScopeIndexEventArgs.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Event arguments to be able to specify the affected scope at the specified index. 29 /// </summary> 27 30 public class ScopeIndexEventArgs : ItemIndexEventArgs { 31 /// <summary> 32 /// Gets the affected scope. 33 /// </summary> 34 /// <remarks>Uses property <see cref="ItemEventArgs.Item"/> of base class 35 /// <see cref="ItemIndexEventArgs"/>. No own data storage present.</remarks> 28 36 public IScope Scope { 29 37 get { return (IScope)Item; } 30 38 } 31 39 40 /// <summary> 41 /// Initializes a new instance of <see cref="ScopeIndexEventArgs"/> with the specified 42 /// <paramref name="scope"/> and <paramref name="index"/>. 43 /// </summary> 44 /// <remarks>Calls constructor of base class <see cref="ItemIndexEventArgs"/>.</remarks> 45 /// <param name="scope">The affected scope.</param> 46 /// <param name="index">The affected index.</param> 32 47 public ScopeIndexEventArgs(IScope scope, int index) 33 48 : base(scope, index) { -
trunk/sources/HeuristicLab.Core/ScopeView.cs
r2 r776 30 30 31 31 namespace HeuristicLab.Core { 32 /// <summary> 33 /// The visual represenation of <see cref="IScope"/>. 34 /// </summary> 32 35 public partial class ScopeView : ViewBase { 33 36 private Dictionary<IScope, TreeNode> scopeNodeTable; 34 37 private Dictionary<IScope, bool> scopeExpandedTable; 35 38 39 /// <summary> 40 /// Gets or sets the scope to represent visually. 41 /// </summary> 42 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 43 /// No own data storage present.</remarks> 36 44 public IScope Scope { 37 45 get { return (IScope)Item; } … … 39 47 } 40 48 private bool myAutomaticUpdating; 49 /// <summary> 50 /// Gets information whether the scope is automatically updating. 51 /// </summary> 41 52 public bool AutomaticUpdating { 42 53 get { return myAutomaticUpdating; } 43 54 } 44 55 56 /// <summary> 57 /// Initializes a new instance of <see cref="ScopeView"/> with caption "Scope" and 58 /// property <see cref="AutomaticUpdating"/> set to <c>false</c>. 59 /// </summary> 45 60 public ScopeView() { 46 61 InitializeComponent(); … … 50 65 myAutomaticUpdating = false; 51 66 } 67 /// <summary> 68 /// Initializes a new instance of <see cref="ScopeView"/> with the given <paramref name="scope"/>. 69 /// </summary> 70 /// <remarks>Calls <see cref="ScopeView()"/>.</remarks> 71 /// <param name="scope">The scope to represent visually.</param> 52 72 public ScopeView(IScope scope) 53 73 : this() { … … 55 75 } 56 76 77 /// <summary> 78 /// Updates all controls with the latest data of the model. 79 /// </summary> 80 /// <remarks>Calls <see cref="ViewBase.UpdateControls"/> of base class <see cref="ViewBase"/>.</remarks> 57 81 protected override void UpdateControls() { 58 82 base.UpdateControls(); -
trunk/sources/HeuristicLab.Core/StorableBase.cs
r40 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// The base class for all storable objects. 30 /// </summary> 28 31 public abstract class StorableBase : IStorable { 29 32 private Guid myGuid; 33 /// <summary> 34 /// Gets the Guid of the item. 35 /// </summary> 30 36 public Guid Guid { 31 37 get { return myGuid; } 32 38 } 33 39 40 /// <summary> 41 /// Initializes a new instance of the class <see cref="StorableBase"/> with a new <see cref="Guid"/>. 42 /// </summary> 34 43 protected StorableBase() { 35 44 myGuid = Guid.NewGuid(); 36 45 } 37 46 47 /// <summary> 48 /// Clones the current instance (deep clone). 49 /// </summary> 50 /// <remarks>Uses the <see cref="Auxiliary.Clone"/> method of the class <see cref="Auxiliary"/>.</remarks> 51 /// <returns>The clone.</returns> 38 52 public object Clone() { 39 53 return Auxiliary.Clone(this, new Dictionary<Guid, object>()); 40 54 } 55 /// <summary> 56 /// Clones the current instance with the <see cref="M:Activator.CreateInstance"/> 57 /// method of <see cref="Activator"/>. 58 /// </summary> 59 /// <param name="clonedObjects">All already cloned objects.</param> 60 /// <returns>The clone.</returns> 41 61 public virtual object Clone(IDictionary<Guid, object> clonedObjects) { 42 62 object clone = Activator.CreateInstance(this.GetType()); … … 45 65 } 46 66 67 /// <summary> 68 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 69 /// </summary> 70 /// <remarks>The type of the current instance is saved as <see cref="XmlAttribute"/> with tag name 71 /// <c>Type</c>, the guid is also saved as an attribute with the tag name <c>GUID</c>.</remarks> 72 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 73 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 74 /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param> 75 /// <returns>The saved <see cref="XmlNode"/>.</returns> 47 76 public virtual XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) { 48 77 XmlNode node = document.CreateNode(XmlNodeType.Element, name, null); … … 55 84 return node; 56 85 } 86 /// <summary> 87 /// Loads the persisted object from the specified <paramref name="node"/>. 88 /// </summary> 89 /// <remarks>Loads only guid; type,... already loaded by the <see cref="PersistenceManager"/>.</remarks> 90 /// <param name="node">The <see cref="XmlNode"/> where the object is saved.</param> 91 /// <param name="restoredObjects">The dictionary of all already restored objects. 92 /// (Needed to avoid cycles.)</param> 57 93 public virtual void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 58 94 myGuid = new Guid(node.Attributes["GUID"].Value); -
trunk/sources/HeuristicLab.Core/Variable.cs
r701 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Represents a variable of an operator having a name and a value. 30 /// </summary> 28 31 public class Variable : ItemBase, IVariable { 29 32 private string myName; 33 /// <inheritdoc/> 34 /// <remarks>Calls <see cref="OnNameChanging"/> and also <see cref="OnNameChanged"/> 35 /// eventually in the setter.</remarks> 30 36 public string Name { 31 37 get { return myName; } … … 42 48 } 43 49 private IItem myValue; 50 /// <inheritdoc/> 51 /// <remarks>Calls <see cref="OnValueChanged"/> in the setter.</remarks> 44 52 public IItem Value { 45 53 get { return myValue; } … … 51 59 } 52 60 } 53 61 62 /// <summary> 63 /// Initializes a new instance of <see cref="Variable"/> with name <c>Anonymous</c> 64 /// and value <c>null</c>. 65 /// </summary> 54 66 public Variable() { 55 67 myName = "Anonymous"; 56 68 myValue = null; 57 69 } 70 /// <summary> 71 /// Initializes a new instance of <see cref="Variable"/> with the specififed <paramref name="name"/> 72 /// and the specified <paramref name="value"/>. 73 /// </summary> 74 /// <param name="name">The name of the current instance.</param> 75 /// <param name="value">The value of the current instance.</param> 58 76 public Variable(string name, IItem value) { 59 77 myName = name; … … 61 79 } 62 80 81 /// <inheritdoc cref="IVariable.GetValue<T>"/> 63 82 public T GetValue<T>() where T : class, IItem { 64 83 return (T)Value; 65 84 } 66 85 86 /// <summary> 87 /// Creates a new instance of <see cref="VariableView"/> to represent the current instance visually. 88 /// </summary> 89 /// <returns>The created view as <see cref="VariableView"/>.</returns> 67 90 public override IView CreateView() { 68 91 return new VariableView(this); 69 92 } 70 93 94 /// <summary> 95 /// Clones the current instance (deep clone). 96 /// </summary> 97 /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param> 98 /// <returns>The cloned object as <see cref="Variable"/>.</returns> 71 99 public override object Clone(IDictionary<Guid, object> clonedObjects) { 72 100 Variable clone = new Variable(); … … 78 106 } 79 107 108 /// <summary> 109 /// Gets the string representation of the current instance in the format: <c>Name: [null|Value]</c>. 110 /// </summary> 111 /// <returns>The current instance as a string.</returns> 80 112 public override string ToString() { 81 113 return Name + ": " + ((Value == null) ? ("null") : (Value.ToString())); 82 114 } 83 115 116 /// <inheritdoc/> 84 117 public event EventHandler<NameChangingEventArgs> NameChanging; 118 /// <summary> 119 /// Fires a new <c>NameChanging</c> event. 120 /// </summary> 121 /// <param name="e">The event arguments of the changing.</param> 85 122 protected virtual void OnNameChanging(NameChangingEventArgs e) { 86 123 if (NameChanging != null) 87 124 NameChanging(this, e); 88 125 } 126 /// <inheritdoc/> 89 127 public event EventHandler NameChanged; 128 /// <summary> 129 /// Fires a new <c>NameChanged</c> event. 130 /// </summary> 131 /// <remarks>Calls <see cref="ItemBase.OnChanged"/>.</remarks> 90 132 protected virtual void OnNameChanged() { 91 133 if (NameChanged != null) … … 93 135 OnChanged(); 94 136 } 137 /// <inheritdoc/> 95 138 public event EventHandler ValueChanged; 139 /// <summary> 140 /// Fires a new <c>ValueChanged</c> even. 141 /// </summary> 96 142 protected virtual void OnValueChanged() { 97 143 if (ValueChanged != null) … … 101 147 102 148 #region Persistence Methods 149 /// <summary> 150 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 151 /// </summary> 152 /// <remarks>Calls <see cref="StorableBase.GetXmlNode"/> of base class <see cref="ItemBase"/>.<br/> 153 /// The name of the current instance is saved as an <see cref="XmlAttribute"/> with the 154 /// tag name <c>Name</c>, the value is saved as child node with the tag name <c>Value</c>.</remarks> 155 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 156 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 157 /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param> 158 /// <returns>The saved <see cref="XmlNode"/>.</returns> 103 159 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) { 104 160 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 110 166 return node; 111 167 } 168 /// <summary> 169 /// Loads the persisted variable from the specified <paramref name="node"/>. 170 /// </summary> 171 /// <remarks>See <see cref="GetXmlNode"/> to get information on how the variable must be saved.<br/> 172 /// Calls <see cref="StorableBase.Populate"/> of base class <see cref="ItemBase"/>.</remarks> 173 /// <param name="node">The <see cref="XmlNode"/> where the variable is saved.</param> 174 /// <param name="restoredObjects">The dictionary of all already restored objects. 175 /// (Needed to avoid cycles.)</param> 112 176 public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 113 177 base.Populate(node, restoredObjects); -
trunk/sources/HeuristicLab.Core/VariableEventArgs.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Event arguments to be able to specify the affected variable. 29 /// </summary> 27 30 public class VariableEventArgs : ItemEventArgs { 31 /// <summary> 32 /// Gets the affected variable. 33 /// </summary> 34 /// <remarks>Uses property <see cref="ItemEventArgs.Item"/> of base class <see cref="ItemEventArgs"/>. 35 /// No own data storage present.</remarks> 28 36 public IVariable Variable { 29 37 get { return (IVariable)Item; } 30 38 } 31 39 40 /// <summary> 41 /// Initializes a new instance of <see cref="VariableEventArgs"/> with the specified 42 /// <paramref name="variable"/>. 43 /// </summary> 44 /// <remarks>Calls constructor of base class <see cref="ItemEventArgs"/>.</remarks> 45 /// <param name="variable">The affected variable.</param> 32 46 public VariableEventArgs(IVariable variable) 33 47 : base(variable) { -
trunk/sources/HeuristicLab.Core/VariableInfo.cs
r533 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Class for storing meta-information about variables/parameters of an operator. 30 /// </summary> 28 31 public class VariableInfo : ItemBase, IVariableInfo { 29 32 private string myActualName; 33 /// <summary> 34 /// Gets or sets the actual name of the current instance. 35 /// </summary> 36 /// <remarks>Calls <see cref="OnActualNameChanged"/> in the setter.</remarks> 30 37 public string ActualName { 31 38 get { return myActualName; } … … 38 45 } 39 46 private string myFormalName; 47 /// <summary> 48 /// Gets the formal name of the current instance. 49 /// </summary> 40 50 public string FormalName { 41 51 get { return myFormalName; } 42 52 } 43 53 private string myDescription; 54 /// <summary> 55 /// Gets the description of the current instance. 56 /// </summary> 44 57 public string Description { 45 58 get { return myDescription; } 46 59 } 47 60 private Type myDataType; 61 /// <summary> 62 /// Gets the data type of the parameter. 63 /// </summary> 48 64 public Type DataType { 49 65 get { return myDataType; } 50 66 } 51 67 private VariableKind myKind; 68 /// <summary> 69 /// Gets the kind of the parameter (input parameter, output parameter,...). 70 /// </summary> 52 71 public VariableKind Kind { 53 72 get { return myKind; } 54 73 } 55 74 private bool myLocal; 75 /// <summary> 76 /// Gets or sets a boolean value, whether the variable is a local one. 77 /// </summary> 78 /// <remarks>Calls <see cref="OnLocalChanged"/> in the setter.</remarks> 56 79 public bool Local { 57 80 get { return myLocal; } … … 64 87 } 65 88 89 /// <summary> 90 /// Initializes a new instance of <see cref="VariableInfo"/> with actual and formal name "Anonymous", 91 /// no description, a <c>null</c> data type and the <c>local</c> flag set to <c>false</c>. The type of 92 /// the variable is an input parameter. 93 /// </summary> 66 94 public VariableInfo() { 67 95 myActualName = "Anonymous"; … … 72 100 myLocal = false; 73 101 } 102 /// <summary> 103 /// Initializes a new instance of <see cref="VariableInfo"/> with the given parameters. 104 /// </summary> 105 /// <remarks>Calls <see cref="VariableInfo()"/>.<br/> 106 /// The formal name is assigned to the actual name, too.</remarks> 107 /// <param name="formalName">The formal name of the current instance.</param> 108 /// <param name="description">The description of the current instance.</param> 109 /// <param name="dataType">The data type of the parameter.</param> 110 /// <param name="kind">The type of the parameter.</param> 74 111 public VariableInfo(string formalName, string description, Type dataType, VariableKind kind) 75 112 : this() { … … 81 118 } 82 119 120 /// <summary> 121 /// Creates a new instance of <see cref="VariableInfoView"/> to represent the current instance 122 /// visually. 123 /// </summary> 124 /// <returns>The created view as <see cref="VariableInfoView"/>.</returns> 83 125 public override IView CreateView() { 84 126 return new VariableInfoView(this); 85 127 } 86 128 129 /// <summary> 130 /// Clones the current instance (deep clone). 131 /// </summary> 132 /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param> 133 /// <returns>The cloned object as <see cref="VariableInfo"/>.</returns> 87 134 public override object Clone(IDictionary<Guid, object> clonedObjects) { 88 135 VariableInfo clone = new VariableInfo(); … … 97 144 } 98 145 146 /// <inheritdoc/> 99 147 public event EventHandler ActualNameChanged; 148 /// <summary> 149 /// Fires a new <c>ActualNameChanged</c> event. 150 /// </summary> 100 151 protected virtual void OnActualNameChanged() { 101 152 if (ActualNameChanged != null) 102 153 ActualNameChanged(this, new EventArgs()); 103 154 } 155 /// <inheritdoc /> 104 156 public event EventHandler LocalChanged; 157 /// <summary> 158 /// Fires a new <c>LocalChanged</c> event. 159 /// </summary> 105 160 protected virtual void OnLocalChanged() { 106 161 if (LocalChanged != null) … … 109 164 110 165 #region Persistence Methods 166 /// <summary> 167 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 168 /// </summary> 169 /// <remarks>Calls <see cref="StorableBase.GetXmlNode"/> of base class <see cref="ItemBase"/>. <br/> 170 /// A quick overview how the single elements of the current instance are saved: 171 /// <list type="bullet"> 172 /// <item> 173 /// <term>Actual name: </term> 174 /// <description>Saved as <see cref="XmlAttribute"/> with tag name <c>ActualName</c>.</description> 175 /// </item> 176 /// <item> 177 /// <term>Formal name: </term> 178 /// <description>Saves as <see cref="XmlAttribute"/> with tag name <c>FormalName</c>.</description> 179 /// </item> 180 /// <item> 181 /// <term>Description: </term> 182 /// <description>Saved as <see cref="XmlAttribute"/> with tag name <c>Description</c>.</description> 183 /// </item> 184 /// <item><term>Data type: </term> 185 /// <description>Saved as <see cref="XmlAttribute"/> with tag name <c>DataType</c>.</description> 186 /// </item> 187 /// <item> 188 /// <term>Kind: </term> 189 /// <description>Saved as <see cref="XmlAttribute"/> with tag name <c>Kind</c>.</description> 190 /// </item> 191 /// <item> 192 /// <term>Local: </term> 193 /// <description>Saved as <see cref="XmlAttribute"/> with tag name <c>Local</c>.</description> 194 /// </item> 195 /// </list></remarks> 196 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 197 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 198 /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param> 199 /// <returns>The saved <see cref="XmlNode"/>.</returns> 111 200 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) { 112 201 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 137 226 return node; 138 227 } 228 /// <summary> 229 /// Loads the persisted variable info from the specified <paramref name="node"/>. 230 /// </summary> 231 /// <remarks>See <see cref="GetXmlNode"/> for further information on how the variable info must be 232 /// saved. <br/> 233 /// Calls <see cref="StorableBase.Populate"/> of base class <see cref="ItemBase"/>.</remarks> 234 /// <param name="node">The <see cref="XmlNode"/> where the variable info is saved.</param> 235 /// <param name="restoredObjects">The dictionary of all already restored objects. 236 /// (Needed to avoid cycles.)</param> 139 237 public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 140 238 base.Populate(node, restoredObjects); -
trunk/sources/HeuristicLab.Core/VariableInfoEventArgs.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Event arguments to be able to specify the affected variable info. 29 /// </summary> 27 30 public class VariableInfoEventArgs : ItemEventArgs { 31 /// <summary> 32 /// Gets the affected variable info. 33 /// </summary> 34 /// <remarks>Uses property <see cref="ItemEventArgs.Item"/> of base class <see cref="ItemEventArgs"/>. 35 /// No own data storage present.</remarks> 28 36 public IVariableInfo VariableInfo { 29 37 get { return (IVariableInfo)Item; } 30 38 } 31 39 40 /// <summary> 41 /// Initializes a new instance of <see cref="VariableInfoEventArgs"/> with the specified 42 /// <paramref name="variableInfo"/>. 43 /// </summary> 44 /// <remarks>Calls constructor of base class <see cref="ItemEventArgs"/>.</remarks> 45 /// <param name="variableInfo">The affected variable info.</param> 32 46 public VariableInfoEventArgs(IVariableInfo variableInfo) 33 47 : base(variableInfo) { -
trunk/sources/HeuristicLab.Core/VariableInfoView.cs
r2 r776 29 29 30 30 namespace HeuristicLab.Core { 31 /// <summary> 32 /// The visual representation of <see cref="IVariableInfo"/>. 33 /// </summary> 31 34 public partial class VariableInfoView : ViewBase { 35 /// <summary> 36 /// Gets or sets the variable information to represent visually. 37 /// </summary> 38 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 39 /// No own data storage present.</remarks> 32 40 public IVariableInfo VariableInfo { 33 41 get { return (IVariableInfo)Item; } … … 35 43 } 36 44 45 /// <summary> 46 /// Initializes a new instance of <see cref="VariableInfoView"/> with caption "Variable Info". 47 /// </summary> 37 48 public VariableInfoView() { 38 49 InitializeComponent(); 39 50 Caption = "Variable Info"; 40 51 } 52 /// <summary> 53 /// Initializes a new instance of <see cref="VariableInfoView"/> 54 /// with the given <paramref name="variableInfo"/>. 55 /// </summary> 56 /// <remarks>Calls <see cref="VariableInfoView()"/>.</remarks> 57 /// <param name="variableInfo">The variable info to represent visually.</param> 41 58 public VariableInfoView(IVariableInfo variableInfo) 42 59 : this() { … … 44 61 } 45 62 63 /// <summary> 64 /// Removes the eventhandlers from the underlying <see cref="IVariableInfo"/>. 65 /// </summary> 66 /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class 67 /// <see cref="ViewBase"/>.</remarks> 46 68 protected override void RemoveItemEvents() { 47 69 VariableInfo.ActualNameChanged -= new EventHandler(VariableInfo_ActualNameChanged); … … 49 71 base.RemoveItemEvents(); 50 72 } 73 /// <summary> 74 /// Adds eventhandlers to the underlying <see cref="IVariableInfo"/>. 75 /// </summary> 76 /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 51 77 protected override void AddItemEvents() { 52 78 base.AddItemEvents(); … … 54 80 VariableInfo.LocalChanged += new EventHandler(VariableInfo_LocalChanged); 55 81 } 56 82 /// <summary> 83 /// Updates all controls with the latest data of the model. 84 /// </summary> 85 /// <remarks>Calls <see cref="ViewBase.UpdateControls"/> of base class <see cref="ViewBase"/>.</remarks> 57 86 protected override void UpdateControls() { 58 87 base.UpdateControls(); -
trunk/sources/HeuristicLab.Core/VariableKind.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Represents the type of a variable (input, output,...). 29 /// </summary> 27 30 [FlagsAttribute] 28 31 public enum VariableKind { 32 /// <summary> 33 /// Flag for doing nothing with the variable. 34 /// </summary> 29 35 None = 0, 36 /// <summary> 37 /// Flag for creating a new variable. 38 /// </summary> 30 39 New = 1, 40 /// <summary> 41 /// Flag for changing value of a variable. 42 /// </summary> 31 43 Out = 2, 44 /// <summary> 45 /// Flag for reading value of a variable. 46 /// </summary> 32 47 In = 4, 48 /// <summary> 49 /// Flag for deleting a variable. 50 /// </summary> 33 51 Deleted = 8 34 52 } -
trunk/sources/HeuristicLab.Core/VariableView.cs
r2 r776 29 29 30 30 namespace HeuristicLab.Core { 31 /// <summary> 32 /// The visual representation of an <see cref="IVariable"/>. 33 /// </summary> 31 34 public partial class VariableView : ViewBase { 32 35 private ChooseItemDialog chooseItemDialog; 33 36 37 /// <summary> 38 /// Gets or sets the variable to represent visually. 39 /// </summary> 40 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 41 /// No own data storage present.</remarks> 34 42 public IVariable Variable { 35 43 get { return (IVariable)Item; } … … 37 45 } 38 46 47 /// <summary> 48 /// Initializes a new instance of <see cref="VariableView"/> with caption "Variable". 49 /// </summary> 39 50 public VariableView() { 40 51 InitializeComponent(); 41 52 Caption = "Variable"; 42 53 } 54 /// <summary> 55 /// Initializes a new instance of <see cref="VariableView"/> with the given <paramref name="variable"/>. 56 /// </summary> 57 /// <remarks>Calls <see cref="VariableView()"/>.</remarks> 58 /// <param name="variable">The variable to represent visually.</param> 43 59 public VariableView(IVariable variable) 44 60 : this() { … … 46 62 } 47 63 64 /// <summary> 65 /// Removes the eventhandlers from the underlying <see cref="IVariable"/>. 66 /// </summary> 67 /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 48 68 protected override void RemoveItemEvents() { 49 69 Variable.NameChanged -= new EventHandler(Variable_NameChanged); … … 51 71 base.RemoveItemEvents(); 52 72 } 73 /// <summary> 74 /// Adds eventhandlers to the underlying <see cref="IVariable"/>. 75 /// </summary> 76 /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 53 77 protected override void AddItemEvents() { 54 78 base.AddItemEvents(); … … 57 81 } 58 82 83 /// <summary> 84 /// Updates all controls with the latest data of the model. 85 /// </summary> 86 /// <remarks>Calls <see cref="ViewBase.UpdateControls"/> of base class <see cref="ViewBase"/>.</remarks> 59 87 protected override void UpdateControls() { 60 88 base.UpdateControls(); -
trunk/sources/HeuristicLab.Core/VariablesScopeView.cs
r2 r776 29 29 30 30 namespace HeuristicLab.Core { 31 /// <summary> 32 /// The visual representation of all variables in a specified scope. 33 /// </summary> 31 34 public partial class VariablesScopeView : ViewBase { 32 35 private ChooseItemDialog chooseItemDialog; 33 36 37 /// <summary> 38 /// Gets or sets the scope whose variables to represent visually. 39 /// </summary> 40 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 41 /// No won data storage present.</remarks> 34 42 public IScope Scope { 35 43 get { return (IScope)Item; } … … 37 45 } 38 46 47 /// <summary> 48 /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View". 49 /// </summary> 39 50 public VariablesScopeView() { 40 51 InitializeComponent(); 41 52 Caption = "Variables Scope View"; 42 53 } 54 /// <summary> 55 /// Initializes a new instance of <see cref="VariablesScopeView"/> with 56 /// the given <paramref name="scope"/>. 57 /// </summary> 58 /// <remarks>Calls <see cref="VariablesScopeView()"/>.</remarks> 59 /// <param name="scope">The scope whose variables should be represented visually.</param> 43 60 public VariablesScopeView(IScope scope) 44 61 : this() { … … 46 63 } 47 64 65 /// <summary> 66 /// Removes the eventhandlers from the underlying <see cref="IScope"/>. 67 /// </summary> 68 /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 48 69 protected override void RemoveItemEvents() { 49 70 Scope.VariableAdded -= new EventHandler<VariableEventArgs>(Scope_VariableAdded); … … 51 72 base.RemoveItemEvents(); 52 73 } 74 /// <summary> 75 /// Adds eventhandlers to the underlying <see cref="IScope"/>. 76 /// </summary> 77 /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 53 78 protected override void AddItemEvents() { 54 79 base.AddItemEvents(); … … 57 82 } 58 83 84 /// <summary> 85 /// Updates all controls with the latest data of the model. 86 /// </summary> 87 /// <remarks>Calls <see cref="ViewBase.UpdateControls"/> of base class <see cref="ViewBase"/>.</remarks> 59 88 protected override void UpdateControls() { 60 89 base.UpdateControls(); -
trunk/sources/HeuristicLab.Core/ViewBase.cs
r2 r776 30 30 31 31 namespace HeuristicLab.Core { 32 /// <summary> 33 /// Base class for all visual representations. 34 /// </summary> 32 35 public partial class ViewBase : UserControl, IView { 33 36 private IItem myItem; 37 /// <summary> 38 /// Gets or sets the item to represent visually. 39 /// </summary> 40 /// <remarks>Calls <see cref="OnItemChanged"/>, <see cref="Refresh"/>, 41 /// <see cref="RemoveItemEvents"/> (if the current item is not null) and 42 /// <see cref="AddItemEvents"/> (if the new item is not null) in the setter.</remarks> 34 43 public IItem Item { 35 44 get { return myItem; } … … 47 56 } 48 57 private string myCaption; 58 /// <summary> 59 /// Gets or sets the caption of the current instance. 60 /// </summary> 61 /// <remarks>Call <see cref="OnCaptionChanged"/> in the setter if a new item is set.</remarks> 49 62 public string Caption { 50 63 get { return myCaption; } … … 57 70 } 58 71 72 /// <summary> 73 /// Initializes a new instance of <see cref="ViewBase"/> with the caption "View". 74 /// </summary> 59 75 public ViewBase() { 60 76 InitializeComponent(); … … 62 78 } 63 79 80 /// <summary> 81 /// Removes the eventhandlers from the current instance. 82 /// </summary> 64 83 protected virtual void RemoveItemEvents() { } 84 /// <summary> 85 /// Adds eventhandlers to the current instance. 86 /// </summary> 65 87 protected virtual void AddItemEvents() { } 66 88 89 /// <summary> 90 /// Refreshes the current view. 91 /// </summary> 92 /// <remarks>Creates a new <see cref="MethodInvoker"/> if an invoke is required 93 /// (see <see cref="Control.InvokeRequired"/>.<br/> 94 /// Otherwise calls <see cref="UpdateControls"/> and <see cref="Control.Refresh"/> of base class 95 /// <see cref="System.Windows.Forms.UserControl"/>.</remarks> 67 96 public override void Refresh() { 68 97 if (InvokeRequired) { … … 73 102 } 74 103 } 104 /// <summary> 105 /// Updates the controls with the latest values of the model. 106 /// </summary> 75 107 protected virtual void UpdateControls() { 76 108 if (Item == null) … … 81 113 } 82 114 115 /// <summary> 116 /// Occurs when the current item was changed. 117 /// </summary> 83 118 public event EventHandler ItemChanged; 119 /// <summary> 120 /// Fires a new <c>ItemChanged</c> event. 121 /// </summary> 84 122 protected virtual void OnItemChanged() { 85 123 if (ItemChanged != null) 86 124 ItemChanged(this, new EventArgs()); 87 125 } 126 /// <summary> 127 /// Occurs when the current caption was changed. 128 /// </summary> 88 129 public event EventHandler CaptionChanged; 130 /// <summary> 131 /// Fires a new <c>CaptionChanged</c> event. 132 /// </summary> 89 133 protected virtual void OnCaptionChanged() { 90 134 if (CaptionChanged != null) … … 92 136 } 93 137 138 /// <summary> 139 /// Asynchron call of GUI updating. 140 /// </summary> 141 /// <param name="method">The delegate to invoke.</param> 94 142 protected new void Invoke(Delegate method) { 95 143 // enforce context switch to improve GUI response time … … 101 149 if (!IsDisposed) EndInvoke(result); 102 150 } 151 /// <summary> 152 /// Asynchron call of GUI updating. 153 /// </summary> 154 /// <param name="method">The delegate to invoke.</param> 155 /// <param name="args">The invoke arguments.</param> 103 156 protected new void Invoke(Delegate method, params object[] args) { 104 157 // enforce context switch to improve GUI response time -
trunk/sources/HeuristicLab.Data/BoolData.cs
r763 r776 93 93 /// (see <see cref="GetXmlNode"/>).</remarks> 94 94 /// <param name="node">The <see cref="XmlNode"/> where the boolean value is saved.</param> 95 /// <param name="restoredObjects">The dictionary of all already restored objects. (Needed to avoid cycles.)</param> 95 /// <param name="restoredObjects">The dictionary of all already restored objects. 96 /// (Needed to avoid cycles.)</param> 96 97 public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) { 97 98 base.Populate(node, restoredObjects);
Note: See TracChangeset
for help on using the changeset viewer.