about summary refs log tree commit diff
path: root/MatrixRoomUtils.Desktop/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixRoomUtils.Desktop/Program.cs')
-rw-r--r--MatrixRoomUtils.Desktop/Program.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Desktop/Program.cs b/MatrixRoomUtils.Desktop/Program.cs
new file mode 100644

index 0000000..74ab579 --- /dev/null +++ b/MatrixRoomUtils.Desktop/Program.cs
@@ -0,0 +1,31 @@ +using Avalonia; +using Microsoft.Extensions.Hosting; +using Tmds.DBus.Protocol; + +namespace MatrixRoomUtils.Desktop; + +internal class Program { + private static IHost appHost; + // 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. + [STAThread] + public static async Task Main(string[] args) { + try { + BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + } + catch (DBusException e) { } + catch (Exception e) { + Console.WriteLine(e); + throw; + } + } + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure<App>() + .UsePlatformDetect() + .WithInterFont() + .LogToTrace(); +}