wpf error handling
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace WPF
|
namespace mpvnet
|
||||||
{
|
{
|
||||||
public class WPF
|
public class WPF
|
||||||
{
|
{
|
||||||
@@ -15,6 +15,8 @@ namespace WPF
|
|||||||
Application.Current.Resources.MergedDictionaries.Add(
|
Application.Current.Resources.MergedDictionaries.Add(
|
||||||
Application.LoadComponent(new Uri("mpvnet;component/WPF/Resources.xaml",
|
Application.LoadComponent(new Uri("mpvnet;component/WPF/Resources.xaml",
|
||||||
UriKind.Relative)) as ResourceDictionary);
|
UriKind.Relative)) as ResourceDictionary);
|
||||||
|
|
||||||
|
Application.Current.DispatcherUnhandledException += (sender, e) => App.ShowException(e.Exception);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ namespace mpvnet
|
|||||||
|
|
||||||
AppDomain.CurrentDomain.UnhandledException += (sender, e) => App.ShowException(e.ExceptionObject);
|
AppDomain.CurrentDomain.UnhandledException += (sender, e) => App.ShowException(e.ExceptionObject);
|
||||||
Application.ThreadException += (sender, e) => App.ShowException(e.Exception);
|
Application.ThreadException += (sender, e) => App.ShowException(e.Exception);
|
||||||
|
|
||||||
Msg.SupportURL = "https://github.com/stax76/mpv.net#support";
|
Msg.SupportURL = "https://github.com/stax76/mpv.net#support";
|
||||||
|
|
||||||
TaskbarButtonCreatedMessage = RegisterWindowMessage("TaskbarButtonCreated");
|
TaskbarButtonCreatedMessage = RegisterWindowMessage("TaskbarButtonCreated");
|
||||||
@@ -844,7 +845,7 @@ namespace mpvnet
|
|||||||
|
|
||||||
BuildMenu();
|
BuildMenu();
|
||||||
ContextMenuStrip = ContextMenu;
|
ContextMenuStrip = ContextMenu;
|
||||||
WPF.WPF.Init();
|
WPF.Init();
|
||||||
System.Windows.Application.Current.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
|
System.Windows.Application.Current.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
|
||||||
Cursor.Position = new Point(Cursor.Position.X + 1, Cursor.Position.Y);
|
Cursor.Position = new Point(Cursor.Position.X + 1, Cursor.Position.Y);
|
||||||
MinimumSize = new Size(FontHeight * 9, FontHeight * 9);
|
MinimumSize = new Size(FontHeight * 9, FontHeight * 9);
|
||||||
|
|||||||
Reference in New Issue
Block a user