50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
global using System;
|
|
global using System.Diagnostics;
|
|
global using System.Net;
|
|
global using System.Text;
|
|
global using System.Collections.Generic;
|
|
global using System.Linq;
|
|
global using DTLib;
|
|
global using DTLib.Dtsod;
|
|
global using DTLib.Filesystem;
|
|
global using DTLib.Extensions;
|
|
global using Launcher.Client;
|
|
global using static Launcher.Client.LauncherClient;
|
|
global using static Launcher.Client.Avalonia.LauncherMain;
|
|
using Launcher.Client.Avalonia.GUI;
|
|
|
|
namespace Launcher.Client.Avalonia;
|
|
|
|
public static class LauncherMain
|
|
{
|
|
public static LauncherWindow CurrentLauncherWindow;
|
|
|
|
//it's being used by Avalonia xml preview
|
|
public static AppBuilder BuildAvaloniaApp() =>
|
|
AppBuilder.Configure<App>()
|
|
.UsePlatformDetect()
|
|
.LogToTrace();
|
|
|
|
public static void Main(string[] args)
|
|
{
|
|
try
|
|
{
|
|
LauncherClient.Init();
|
|
var traceHandler = new ConsoleTraceListener();
|
|
Trace.AutoFlush = true;
|
|
Trace.Listeners.Add(traceHandler);
|
|
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogError("STARTUP", ex);
|
|
}
|
|
}
|
|
|
|
public static void LogError(string context, Exception ex)
|
|
{
|
|
string errmsg = $"{ex.Message}\n{ex.StackTrace}";
|
|
MessageBox.Show($"{context} ERROR", errmsg);
|
|
Logger.Log(errmsg);
|
|
}
|
|
} |