about summary refs log tree commit diff
path: root/MatrixUtils.Desktop/Program.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-01-24 02:31:56 +0100
committerRory& <root@rory.gay>2024-01-24 17:05:25 +0100
commit03313562d21d5db9bf6a14ebbeab80e06c883d3a (patch)
treee000546a2ee8e6a886a7ed9fd01ad674178fb7cb /MatrixUtils.Desktop/Program.cs
parentMake RMU installable (diff)
downloadMatrixUtils-03313562d21d5db9bf6a14ebbeab80e06c883d3a.tar.xz
MRU->RMU, fixes, cleanup
Diffstat (limited to 'MatrixUtils.Desktop/Program.cs')
-rw-r--r--MatrixUtils.Desktop/Program.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/MatrixUtils.Desktop/Program.cs b/MatrixUtils.Desktop/Program.cs
new file mode 100644
index 0000000..0f4c09c
--- /dev/null
+++ b/MatrixUtils.Desktop/Program.cs
@@ -0,0 +1,33 @@
+using Avalonia;
+using Microsoft.Extensions.Hosting;
+using Tmds.DBus.Protocol;
+
+namespace MatrixUtils.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 Task Main(string[] args) {
+        try {
+            BuildAvaloniaApp()
+                .StartWithClassicDesktopLifetime(args);
+        }
+        catch (DBusException e) { }
+        catch (Exception e) {
+            Console.WriteLine(e);
+            throw;
+        }
+
+        return Task.CompletedTask;
+    }
+
+    // Avalonia configuration, don't remove; also used by visual designer.
+    public static AppBuilder BuildAvaloniaApp()
+        => AppBuilder.Configure<App>()
+            .UsePlatformDetect()
+            .WithInterFont()
+            .LogToTrace();
+}