예제 #1
0
        internal void Start(TApplication instance)
        {
            Application = instance;
            var bits = IntPtr.Size == 4 ? 32 : 64;

            Log.Verbose($"{bits} Bit System detected. (Pointer Size: {IntPtr.Size} Bytes)");
            Log.Verbose("OS: {OSVersion}", Environment.OSVersion);

            if (Config.UseGtkUI)
            {
                Log.Verbose("Init GtkUI");
                ui = CreateGtkUI();
                ui.Start();
                Log.Verbose("GtkUI initialized");
            }

            if (Config.UseConsole)
            {
                Log.Verbose("Configure for console session");
                th = new Thread(UIThreadMain);
                th.Start();

                ConsoleLoop();

                Application.Stop();
                Application.Dispose();
                th.Abort();
                Environment.Exit(0);
            }
            else
            {
                UIThreadMain();
                Environment.Exit(0);
            }
        }
예제 #2
0
        protected override void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    Application.Dispose();
                    ui.Dispose();
                }
                Application = null;
                ui          = null;

                disposedValue = true;
            }
        }