-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindowException.xaml.cs
50 lines (39 loc) · 1.65 KB
/
WindowException.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
using System;
using System.Windows;
namespace KLC_Finch {
/// <summary>
/// Interaction logic for WindowException.xaml
/// </summary>
public partial class WindowException : Window {
public Exception Exception { get; private set; }
public string ExceptionSource { get; private set; }
public string DetailsText { get; private set; }
public WindowException() {
InitializeComponent();
}
public WindowException(Exception ex, string source) { //, bool allowContinue
Exception = ex;
ExceptionSource = source;
DetailsText = ExceptionSource + "\r\n" + ex.ToString();
this.DataContext = this;
InitializeComponent();
this.Title = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name + " Exception";
//btnContinue.Visibility = (allowContinue ? Visibility.Visible : Visibility.Collapsed);
}
public WindowException(string error, string source) { //, bool allowContinue
Exception = new Exception(source);
ExceptionSource = source;
DetailsText = error;
this.DataContext = this;
InitializeComponent();
this.Title = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name + " Exception";
//btnContinue.Visibility = (allowContinue ? Visibility.Visible : Visibility.Collapsed);
}
private void OnExitAppClick(object sender, RoutedEventArgs e) {
Environment.Exit(0);
}
private void OnContinueAppClick(object sender, RoutedEventArgs e) {
Close();
}
}
}