-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.xaml.cs
More file actions
27 lines (22 loc) · 828 Bytes
/
App.xaml.cs
File metadata and controls
27 lines (22 loc) · 828 Bytes
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
using System.Configuration;
using System.Data;
using System.Windows;
using System.Windows.Threading;
using System.IO;
namespace SimpleUsefulTimer
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs args)
{
MessageBox.Show("Uh oh! The program has suffered a fatal crash. Please view log file in same directory as this Timer app for more information.");
File.WriteAllText($"{Directory.GetCurrentDirectory()}/crash-{new Random().Next()}.txt", args.Exception.ToString());
// Prevent default unhandled exception processing
args.Handled = true;
Environment.Exit(0);
}
}
}