Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/19/08 12:12:39 (16 years ago)
Author:
vdorfer
Message:

Created API documentation for HeuristicLab.Core namespace (#331)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/Auxiliary.cs

    r2 r776  
    2626
    2727namespace HeuristicLab.Core {
     28  /// <summary>
     29  /// Static helper class.
     30  /// </summary>
    2831  public static class Auxiliary {
    2932    #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>
    3040    public static object Clone(IStorable obj, IDictionary<Guid, object> clonedObjects) {
    3141      object clone;
     
    3848
    3949    #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>
    4054    public static void ShowErrorMessageBox(string message) {
    4155      MessageBox.Show(message,
     
    4458                      MessageBoxIcon.Error);
    4559    }
     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>
    4664    public static void ShowErrorMessageBox(Exception ex) {
    4765      MessageBox.Show(BuildErrorMessage(ex),
     
    5068                      MessageBoxIcon.Error);
    5169    }
     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>
    5275    private static string BuildErrorMessage(Exception ex) {
    5376      StringBuilder sb = new StringBuilder();
     
    6386
    6487    #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>
    6593    public static void ShowConstraintViolationMessageBox(ICollection<IConstraint> violatedConstraints) {
    6694      string message = BuildConstraintViolationMessage(violatedConstraints);
     
    7098                      MessageBoxIcon.Warning);
    7199    }
     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>
    72106    public static DialogResult ShowIgnoreConstraintViolationMessageBox(ICollection<IConstraint> violatedConstraints) {
    73107      string message = BuildConstraintViolationMessage(violatedConstraints);
     
    77111                             MessageBoxIcon.Question);
    78112    }
     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>
    79119    private static string BuildConstraintViolationMessage(ICollection<IConstraint> violatedConstraints) {
    80120      StringBuilder sb = new StringBuilder();
Note: See TracChangeset for help on using the changeset viewer.