-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.xaml.cs
41 lines (38 loc) · 1.26 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.Reflection;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
using VMDToBVH.Views;
namespace VMDToBVH
{
/// <summary>
/// App.xaml の相互作用ロジック
/// </summary>
public partial class App : Application
{
private void Application_Startup(object sender, StartupEventArgs e)
{
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
}
Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs e)
{
if (!e.Name.Contains(".resources,"))
{
MessageBox.Show(string.Format("アセンブリ「{0}」の解決に失敗しました。", e.Name));
}
return null;
}
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
var dialog = new ErrorDialog();
dialog.Message = e.ExceptionObject.ToString();
dialog.ShowDialog();
}
}
}