示例#1
0
        private static void Main()
        {
            // Bind any unhandled exceptions in the main thread so that they are logged.
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            log4net.Config.XmlConfigurator.Configure();

            Log.Info("----------------");
            Log.Info($"Launchpad v{Config.GetLocalLauncherVersion()} starting...");
            Log.Info($"Current platform: {ConfigHandler.GetCurrentPlatform()} ({(Environment.Is64BitOperatingSystem ? "x64" : "x86")})");

            // Set correct working directory for compatibility with double-clicking
            Directory.SetCurrentDirectory(ConfigHandler.GetLocalDir());

            Log.Info("Initializing UI...");

            // Bind any unhandled exceptions in the GTK UI so that they are logged.
            GLib.ExceptionManager.UnhandledException += OnGLibUnhandledException;

            // Run the GTK UI
            Gtk.Application.Init();
            MainWindow win = new MainWindow();

            win.Show();
            win.Initialize();
            Gtk.Application.Run();
        }
示例#2
0
        private static void Main()
        {
            // Bind any unhandled exceptions in the main thread so that they are logged.
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            Log.Info("----------------");
            Log.Info($"Launchpad v{Config.GetLocalLauncherVersion()} starting...");
            Log.Info($"Current platform: {ConfigHandler.GetCurrentPlatform()} ({(Environment.Is64BitOperatingSystem ? "x64" : "x86")})");

            // Set correct working directory for compatibility with double-clicking
            Directory.SetCurrentDirectory(ConfigHandler.GetLocalDir());

            if (ChecksHandler.IsRunningOnUnix())
            {
                Log.Info("Initializing GTK UI.");
                RunUnixInterface();
            }
            else
            {
                Log.Info("Initializing WinForms UI.");
                RunWindowsInterface();
            }
        }