port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace Tweaky
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public App()
{
this.DispatcherUnhandledException += App_DispatcherUnhandledException;
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
}
private void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
{
try
{
ShowException(e.ExceptionObject as Exception);
this.Shutdown();
}
catch
{
}
}
void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
try
{
ShowException(e.Exception);
this.Shutdown();
}
catch
{
}
}
private static void ShowException(Exception exception)
{
var message = exception.Message + " at:\n" + exception.StackTrace + "\n\n";
do
{
exception = exception.InnerException;
if (exception != null)
message += exception.Message + " at:\n" + exception.StackTrace + "\n\n";
}
while (exception != null);
System.Windows.Forms.MessageBox.Show(message, "Unhandled exception");
}
}
}