mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
54 lines
1.3 KiB
C#
54 lines
1.3 KiB
C#
using AssetRipper.Import.Logging;
|
|
using Avalonia;
|
|
|
|
namespace AssetRipper.GUI
|
|
{
|
|
static class Program
|
|
{
|
|
//https://docs.microsoft.com/en-us/dotnet/api/system.stathreadattribute?view=net-6.0
|
|
//https://github.com/AvaloniaUI/avalonia-dotnet-templates/pull/58
|
|
[STAThread]
|
|
public static void Main(string[] args)
|
|
{
|
|
if (args.Length == 0)
|
|
{
|
|
Logger.Add(new FileLogger());
|
|
Logger.Add(new ConsoleLogger());
|
|
Logger.LogSystemInformation("AssetRipper GUI Version");
|
|
RunAvalonia();
|
|
}
|
|
else
|
|
{
|
|
ConsoleApp.ParseArgumentsAndRun(args);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Initialization code. Don't use any Avalonia, third-party APIs or any
|
|
/// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
|
/// yet and stuff might break.
|
|
/// </summary>
|
|
private static void RunAvalonia()
|
|
{
|
|
BuildAvaloniaApp().Start(App.AppMain, Array.Empty<string>());
|
|
}
|
|
|
|
/// <summary>
|
|
/// Avalonia configuration, don't remove; also used by visual designer.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
private static AppBuilder BuildAvaloniaApp()
|
|
{
|
|
return AppBuilder.Configure<App>()
|
|
.UsePlatformDetect()
|
|
.With(new X11PlatformOptions
|
|
{
|
|
UseDBusFilePicker = false
|
|
//Disable FreeDesktop file picker
|
|
//https://github.com/AvaloniaUI/Avalonia/issues/9383
|
|
})
|
|
.LogToTrace();
|
|
}
|
|
}
|
|
}
|