Example #1
0
        static void Main()
        {
            XTrace.UseConsole();

            GLib.ExceptionManager.UnhandledException += ExceptionManager_UnhandledException;

            // 检查环境
            GtkHelper.CheckRuntime();

            Application.Init();
            var window = new SharpApp();

            window.ShowAll();
            // Window.InteractiveDebugging = true;
            //XTrace2.UseWinForm(window);
            Application.Run();
        }
Example #2
0
        public static Task CheckRuntime(Int32 msTimeout = 3_000)
        {
            var task = Task.Run(async() =>
            {
                var gtk = new GtkHelper {
                    Log = XTrace.Log
                };
                if (!gtk.Check())
                {
                    await gtk.DownloadAsync();
                }

                gtk.Install();
            });

            // 最多等3秒
            task.Wait(msTimeout);

            return(task);
        }