Exemplo n.º 1
0
        override protected void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            SplashWindow = new MySplashWindow();
            SplashWindow.Show();

            Stopwatch sw = new Stopwatch();

            sw.Start();

#if USE_CONSOLE
            WinAPI.AllocConsole();
            Console.WriteLine("App OnStartup USE_CONSOLE");
#endif

#if USE_CONSOL_INPUT
            InputThread = new DebugInputThread();
            InputThread.start();
#endif

            mMainThreadScheduler = TaskScheduler.FromCurrentSynchronizationContext();

            ThreadUtil.Init();

            OpenTK.Toolkit.Init();

            // MessagePack for C# は、初回の実行が遅いので、起動時にダミーを実行して
            // 紛れさせる
            MpInitializer.Init();

            MainWindow = new MainWindow();

            SetupDebugConsole();

            MainWindow.Show();

            sw.Stop();

            Console.WriteLine($"MainWindow startup. Start up time: {sw.ElapsedMilliseconds} (milli sec)");

            SplashWindow.Close();
            SplashWindow = null;
        }