C# Class BF2Statistics.ExceptionHandler

A simple object to handle exceptions thrown during runtime
Show file Open project: BF2Statistics/ControlCenter

Public Methods

Method Description
GenerateExceptionLog ( Exception E ) : void

Generates a trace log for an exception. If an exception is thrown here, The error will automatically be logged in the programs error log

GenerateExceptionLog ( Exception E, string &FileName ) : void

Generates a trace log for an exception. If an exception is thrown here, The error will automatically be logged in the programs error log

GenerateExceptionLog ( string FileName, Exception E ) : void

Generates a trace log for an exception. If an exception is thrown here, The error will automatically be logged in the programs error log

OnThreadException ( object sender, ThreadExceptionEventArgs t ) : void

Handles an exception on the main thread.

OnUnhandledException ( object sender, UnhandledExceptionEventArgs e ) : void

Handles cross thread exceptions, that are unrecoverable

Private Methods

Method Description
GenerateFileName ( ) : string

Generates a filename to be used for logging

Method Details

GenerateExceptionLog() public static method

Generates a trace log for an exception. If an exception is thrown here, The error will automatically be logged in the programs error log
public static GenerateExceptionLog ( Exception E ) : void
E System.Exception The exception we are logging
return void

GenerateExceptionLog() public static method

Generates a trace log for an exception. If an exception is thrown here, The error will automatically be logged in the programs error log
public static GenerateExceptionLog ( Exception E, string &FileName ) : void
E System.Exception The exception we are logging
FileName string Provides the full file path and name where this exception log is created at.
return void

GenerateExceptionLog() public static method

Generates a trace log for an exception. If an exception is thrown here, The error will automatically be logged in the programs error log
public static GenerateExceptionLog ( string FileName, Exception E ) : void
FileName string The tracelog filepath (Must not exist yet)
E System.Exception The exception to log
return void

OnThreadException() public static method

Handles an exception on the main thread.
public static OnThreadException ( object sender, ThreadExceptionEventArgs t ) : void
sender object
t System.Threading.ThreadExceptionEventArgs
return void

OnUnhandledException() public static method

Handles cross thread exceptions, that are unrecoverable
public static OnUnhandledException ( object sender, UnhandledExceptionEventArgs e ) : void
sender object
e System.UnhandledExceptionEventArgs
return void