mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2024-11-24 20:42:46 +01:00
40 lines
1.1 KiB
C#
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();
|
|
}
|
|
}
|
|
}
|