-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml.cs
28 lines (26 loc) · 891 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
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace MyWindowsMediaPlayer
{
/// <summary>
/// Logique d'interaction pour App.xaml
/// </summary>
public partial class App : Application
{
public App() : base()
{
this.Dispatcher.UnhandledException += Application_UnHandledExceptions;
}
private void Application_UnHandledExceptions(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
System.Windows.Forms.MessageBox.Show("Unknown Exception: " + e.Exception.Message, "Exception", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
App.Current.Shutdown();
e.Handled = true;
}
}
}