forked from sim0n00ps/OF-DL
40 lines
1.4 KiB
C#
40 lines
1.4 KiB
C#
using Avalonia;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using OF_DL.Services;
|
|
using Serilog;
|
|
|
|
namespace OF_DL.Gui;
|
|
|
|
public static class Program
|
|
{
|
|
public static bool HidePrivateInfo { get; private set; }
|
|
|
|
public static void Main(string[] args)
|
|
{
|
|
// Parse command line arguments
|
|
HidePrivateInfo = args.Contains("--hide-private-info", StringComparer.OrdinalIgnoreCase);
|
|
|
|
ServiceCollection services = new();
|
|
services.AddSingleton<ILoggingService, LoggingService>();
|
|
ServiceProvider tempProvider = services.BuildServiceProvider();
|
|
ILoggingService loggingService = tempProvider.GetRequiredService<ILoggingService>();
|
|
|
|
Log.Information("Starting OF DL GUI");
|
|
|
|
// Check if running in Docker and print message
|
|
string? ofdlDocker = Environment.GetEnvironmentVariable("OFDL_DOCKER");
|
|
if (string.Equals(ofdlDocker, "true", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
Console.WriteLine("In your web browser, navigate to the port forwarded from your docker container. For instance, if your docker run command included \"-p 8080:8080\", open your web browser to \"http://localhost:8080\".");
|
|
}
|
|
|
|
BuildAvaloniaApp()
|
|
.StartWithClassicDesktopLifetime(args);
|
|
}
|
|
|
|
private static AppBuilder BuildAvaloniaApp() =>
|
|
AppBuilder.Configure<App>()
|
|
.UsePlatformDetect()
|
|
.LogToTrace();
|
|
}
|