AGS.Editor.ApplicationController.UnhandledErrorHandler C# (CSharp) Метод

UnhandledErrorHandler() публичный Метод

public UnhandledErrorHandler ( Exception ex ) : void
ex System.Exception
Результат void
        public void UnhandledErrorHandler(Exception ex)
        {
            try
            {
                Bitmap screenShot = CaptureScreenshot();
                ExceptionDialog dialog = new ExceptionDialog(ex, screenShot);
                dialog.ShowDialog();
                dialog.Dispose();
                screenShot.Dispose();
            }
            catch
            {
                _guiController.ShowMessage("An unexpected error occurred. Please post the following information on the AGS Technical Forum." + Environment.NewLine + Environment.NewLine + ex.ToString(), MessageBoxIcon.Stop);
            }
            _guiController.ShowMessage("A serious error occurred and the AGS Editor may now be in an unstable state. You are STRONGLY ADVISED to shut down the editor and restart it. Before saving your work, make a backup copy of your game folder in case any data has been corrupted."
                 + Environment.NewLine + Environment.NewLine + "Error: " + ex.ToString(), MessageBoxIcon.Error);
        }

Usage Example

Пример #1
0
 private static void HandleException(Exception ex)
 {
     if (_application != null)
     {
         _application.UnhandledErrorHandler(ex);
     }
     else
     {
         MessageBox.Show("An unexpected error occurred trying to start up the AGS Editor. Please consult the details below and post the error to the AGS Technical Forum.\n\n" + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
     }
 }
All Usage Examples Of AGS.Editor.ApplicationController::UnhandledErrorHandler