Changeset 776 for trunk/sources/HeuristicLab.Core/Auxiliary.cs
- Timestamp:
- 11/19/08 12:12:39 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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();
Note: See TracChangeset
for help on using the changeset viewer.