Ejemplo n.º 1
0
        //程序退出
        public static void Exit(string error_reason = "")
        {
            try
            {
                ToolManager.Close();
                StoryboardWindow.CurrentWindow?.Close();

                if ((!PlayerSetting.MiniMode) && (!string.IsNullOrWhiteSpace(error_reason)))
                {
                    Console.BackgroundColor = ConsoleColor.Red;
                    Console.ForegroundColor = ConsoleColor.Yellow;
                    Console.WriteLine(error_reason);
                    Console.ResetColor();
                    Console.ReadKey();

                    Environment.Exit(2857);//2q1
                }
            }
            catch (Exception e)
            {
                Log.Warn("Can't clean resource and others before exit :" + e.Message);
            }
            finally
            {
                Log.User("Bye~");
                Environment.Exit(0);
            }
        }