-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMessage.cs
32 lines (23 loc) · 901 Bytes
/
Message.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#region Using statements
using System;
using System.Windows.Forms;
#endregion Using statements
namespace HardTop
{
internal static class Message
{
#region Private caption
private static readonly string _caption = $"{Application.ProductName} {Resources.Version} {Application.ProductVersion}";
#endregion Private caption
#region Show Information or Error dialog methods
internal static void Show(string text, Exception ex = null)
{
MessageBox.Show(ex is null ? text : $"{text}\r\n{ex}", _caption, MessageBoxButtons.OK, ex is null ? MessageBoxIcon.Information : MessageBoxIcon.Error);
}
internal static void Show(string text)
{
MessageBox.Show(text, _caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
#endregion Show Information or Error dialog methods
}
}