-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.xaml.cs
41 lines (36 loc) · 1.08 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
41
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
namespace CLauncher2._0
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
this.CloseSplashIfOpen();
this.StartMainFormWhenError();
MessageBox.Show("Error" + Environment.NewLine + e.Exception.Message, "Error");
e.Handled = true;
}
private async void StartMainFormWhenError()
{
await Task.Delay(2000);
Window.test MainWindow = new Window.test();
MainWindow.Show();
MainWindow = (Window.test)null;
}
private void CloseSplashIfOpen()
{
SplashScreen splash = new SplashScreen();
splash.Hide();
}
}
}