Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Core.Views/3.3/Auxiliary.cs @ 3310

Last change on this file since 3310 was 3289, checked in by swagner, 14 years ago

Implemented logs of engines (#963).

File size: 2.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Text;
24using System.Windows.Forms;
25using HeuristicLab.Core;
26
27namespace HeuristicLab.Core.Views {
28  /// <summary>
29  /// Static helper class.
30  /// </summary>
31  public static class Auxiliary {
32    #region Error Messages
33    /// <summary>
34    /// Shows an error message box with a given error <paramref name="message"/> and an OK-Button.
35    /// </summary>
36    /// <param name="message">The error message to display.</param>
37    public static void ShowErrorMessageBox(string message) {
38      MessageBox.Show(message,
39                      "Error",
40                      MessageBoxButtons.OK,
41                      MessageBoxIcon.Error);
42    }
43    /// <summary>
44    /// Shows an error message box with a given exception <paramref name="ex"/> and an OK-Button.
45    /// </summary>
46    /// <param name="ex">The exception to display.</param>
47    public static void ShowErrorMessageBox(Exception ex) {
48      MessageBox.Show(Log.BuildErrorMessage(ex),
49                      "Error - " + ex.GetType().Name,
50                      MessageBoxButtons.OK,
51                      MessageBoxIcon.Error);
52    }
53    #endregion
54  }
55}
Note: See TracBrowser for help on using the repository browser.