コード例 #1
0
        //====================================================================================================================//

        public static void DoErrorHandling(Exception ex, string errorDetails, bool canIgnore = false)
        {
#if DEBUG
            var result = SharpDX.Result.GetResultFromException(ex);

            string Errors = "Directx: " + result.Code + " - " + ex.Message + "\n\n" + ex.StackTrace;

            if (s_infoQueue != null)
            {
                for (int j = 0; j < s_infoQueue.NumStoredMessages; j++)
                {
                    D3D11.Message a = s_infoQueue.GetMessage(j);

                    Errors = a.Description.ToString().Trim('\0') + '\n' + Errors;

                    Console.WriteLine(a.Description.ToString());
                }

                Console.WriteLine(Errors);
            }

#if !WINDOWS_UWP
            Strafe.PopupErrorBox.Show("Object Type: " + ex.TargetSite.DeclaringType.FullName, "Stack Trace: " + ex.StackTrace, "Error Message:" + ex.Message + '\n' + Errors);

            if (!canIgnore)
            {
                Application.Exit();
            }
#endif
#endif
        }