1
0
mirror of https://github.com/chylex/Discord-History-Tracker.git synced 2025-01-05 01:42:51 +01:00
Discord-History-Tracker/app/Desktop/Program.cs
2023-07-21 18:47:21 +02:00

41 lines
1.1 KiB
C#

using System.Globalization;
using System.Reflection;
using Avalonia;
using DHT.Desktop.Resources;
namespace DHT.Desktop;
static class Program {
public static string Version { get; }
public static CultureInfo Culture { get; }
public static ResourceLoader Resources { get; }
static Program() {
var assembly = Assembly.GetExecutingAssembly();
Version = assembly.GetName().Version?.ToString() ?? "";
while (Version.EndsWith(".0")) {
Version = Version[..^2];
}
Culture = CultureInfo.CurrentCulture;
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;
Resources = new ResourceLoader(assembly);
}
public static void Main(string[] args) {
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
private static AppBuilder BuildAvaloniaApp() {
return AppBuilder.Configure<App.App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace();
}
}