wider migration from old starter

This commit is contained in:
maj00r
2026-08-30 22:29:45 +02:00
parent c7853f6588
commit 563a937eb9
44 changed files with 6076 additions and 1457 deletions

View File

@@ -1,5 +1,7 @@
using Avalonia;
using Avalonia;
using System;
using System.Threading.Tasks;
using StarterNG.Infrastructure;
namespace StarterNG;
@@ -7,8 +9,35 @@ class Program
{
[STAThread]
public static void Main(string[] args) => BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
public static void Main(string[] args)
{
AppDomain.CurrentDomain.UnhandledException += (_, e) =>
{
if (e.ExceptionObject is Exception ex)
Diagnostics.Log("Unhandled exception", ex);
Diagnostics.Flush();
};
TaskScheduler.UnobservedTaskException += (_, e) =>
{
Diagnostics.Log("Unobserved task exception", e.Exception);
e.SetObserved();
};
try
{
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
catch (Exception ex)
{
Diagnostics.Log("Fatal", ex);
throw;
}
finally
{
Diagnostics.Flush();
}
}
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()