C# Class CK.AppRecovery.ApplicationRecovery

Show file Open project: Invenietis/ck-certified

Private Properties

Property Type Description
CheckForRecoveryCancel void
CurrentDomain_UnhandledException void
HandleApplicationCrashByOS int
RaiseApplicationCrashedEvent void

Public Methods

Method Description
Initialize ( ) : bool

Registers the application for notification by windows of a failure if IsOSRecoveryAvailable is true.

The AppDomain.CurrentDomain.UnhandledException event is listened and react to such unhandled exceptions int two different ways: If IsOSRecoveryAvailable is true, the exception is memorized and will be dumped out to the crash log during application recovery. If it is false, this immediately triggers the ApplicationCrashed event.

Windows forms is configured to let unhandled execptions be thrown thanks to a call to Application.SetUnhandledExceptionMode with UnhandledExceptionMode.ThrowException.

This method also initializes the CurrentCrashCount from the Environment.GetCommandLineArgs (if any).

Private Methods

Method Description
CheckForRecoveryCancel ( object o ) : void

Checks to see if the user has cancelled the recovery.

CurrentDomain_UnhandledException ( object sender, UnhandledExceptionEventArgs e ) : void
HandleApplicationCrashByOS ( IntPtr pvParameter ) : int

This is the callback function that is executed in the event of the application crashing.

RaiseApplicationCrashedEvent ( ) : void

Method Details

Initialize() public static method

Registers the application for notification by windows of a failure if IsOSRecoveryAvailable is true.

The AppDomain.CurrentDomain.UnhandledException event is listened and react to such unhandled exceptions int two different ways: If IsOSRecoveryAvailable is true, the exception is memorized and will be dumped out to the crash log during application recovery. If it is false, this immediately triggers the ApplicationCrashed event.

Windows forms is configured to let unhandled execptions be thrown thanks to a call to Application.SetUnhandledExceptionMode with UnhandledExceptionMode.ThrowException.

This method also initializes the CurrentCrashCount from the Environment.GetCommandLineArgs (if any).

public static Initialize ( ) : bool
return bool