1
0
mirror of https://github.com/chylex/Discord-History-Tracker.git synced 2024-12-22 14:42:50 +01:00
Discord-History-Tracker/app/Desktop/Program.cs
2022-02-21 22:27:29 +01:00

40 lines
1.1 KiB
C#

using System.Globalization;
using System.Reflection;
using Avalonia;
using DHT.Utils.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>()
.UsePlatformDetect()
.LogToTrace();
}
}
}