-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
App.xaml.cs
40 lines (34 loc) · 1.12 KB
/
App.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
using System.Windows;
using System.Windows.Threading;
using WpfBindingErrors;
namespace BthPS3CfgUI
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public App()
{
DispatcherUnhandledException += delegate(object sender, DispatcherUnhandledExceptionEventArgs args)
{
if (args.Exception is BindingException)
{
MessageBox.Show("BthPS3 filter driver access failed. Are the drivers installed?",
"Filter driver not found", MessageBoxButton.OK,
MessageBoxImage.Error);
Shutdown(-1);
return;
}
MessageBox.Show(args.Exception.Message, "That looks like an error", MessageBoxButton.OK,
MessageBoxImage.Error);
Shutdown(-1);
};
}
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
BindingExceptionThrower.Attach();
}
}
}