public static void InvokeCrashed( CrashedEventArgs e ) { if( Crashed != null ) Crashed( e ); }
private static void CurrentDomain_UnhandledException( object sender, UnhandledExceptionEventArgs e ) { Exception ex = e.ExceptionObject as Exception; CConsole.Write( EConsoleColor.Error, e.IsTerminating ? "Error: " : "Warning: " ); CConsole.WriteLine( EConsoleColor.Error, ex.Message ); if( ex.StackTrace != string.Empty ) CConsole.WriteLine( ex.StackTrace ); if( e.IsTerminating ) { mCrashed = true; bool close = false; try { CrashedEventArgs args = new CrashedEventArgs( e.ExceptionObject as Exception ); Events.InvokeCrashed( args ); close = args.Close; } catch { } if( !close ) { SocketPool.Destroy(); CConsole.ErrorLine( "This exception is fatal, press return to exit" ); CConsole.Read(); } mClosing = true; } }