PlatformerExpandedError
By: a guest | Jun 27th, 2009 | Syntax:
C# | Size: 1.80 KB | Hits: 131 | Expires: Never
using System;
using ErrorReporter;
namespace Platformer_Expanded
{
static class Program
{
static bool debugging = false;
// TO FORCE THE ERROR ENGINE TO BELIEVE IT ISNT IN DEBUG MODE, CHANGE THE VARIABLE BELOW TO TRUE
static bool manualdebugdisable = true;
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
#if DEBUG
if (!manualdebugdisable && System.Diagnostics.Debugger.IsAttached)
{
debugging = true;
}
#endif
if (debugging)
{
using (PlatformerGame game
= new PlatformerGame
())
{
game.Run();
}
}
else
{
while (true)
{
try
{
using (PlatformerGame game
= new PlatformerGame
())
{
game.Run();
break;
}
}
catch (Exception e)
{
try
{
using (ErrorReporter.
ErrorReporter err
= new ErrorReporter.
ErrorReporter(e
))
{
err.RestartEnabled = true;
err.Run();
}
}
catch (RestartNeededException)
{
Main(null);
}
}
}
}
}
}
}