-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml.cs
31 lines (24 loc) · 827 Bytes
/
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
//Project: SpeechTurtle (http://SpeechTurtle.codeplex.com)
//Filename: App.xaml.cs
//Version: 20151208
namespace SpeechTurtle
{
using System;
using System.Windows;
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
#region --- Events ---
private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
Exception outer = e.Exception;
Exception inner = outer.InnerException;
MessageBox.Show((inner ?? outer).Message);
e.Handled = true; //handle the exception
Shutdown(); //gracefully shutdown //TODO: could check here if the UI has loaded OK and in that case not shutdown maybe
}
#endregion
}
}