-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathErrorWindow.xaml.cs
62 lines (55 loc) · 1.38 KB
/
ErrorWindow.xaml.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Windows;
using System.Diagnostics;
namespace Ultima.Spy.Application
{
/// <summary>
/// Interaction logic for ErrorWindow.xaml
/// </summary>
public partial class ErrorWindow : Window
{
#region Constructors
/// <summary>
/// Constructs a new instance of ErrorWindow.
/// </summary>
public ErrorWindow()
{
InitializeComponent();
}
#endregion
#region Methods
/// <summary>
/// Shows error window.
/// </summary>
/// <param name="ex">Exception to show.</param>
public static void Show( Exception ex )
{
ErrorWindow window = new ErrorWindow();
window.ErrorTitle.Text = ex.Message;
window.ErrorMessage.Text = ex.StackTrace;
window.ShowDialog();
}
/// <summary>
/// Shows error window.
/// </summary>
/// <param name="ex">Exception to show.</param>
public static void Show( string title, string format, params string[] args )
{
ErrorWindow window = new ErrorWindow();
window.ErrorTitle.Text = title;
window.ErrorMessage.Text = String.Format( format, args );
window.ShowDialog();
}
#region Event Handlers
private void SubmitBug_Click( object sender, RoutedEventArgs e )
{
Process.Start( "www.google.com" );
}
private void CloseButton_Click( object sender, RoutedEventArgs e )
{
Close();
}
#endregion
#endregion
}
}