public static void RegisterForRecovery() { // Since this registration is being done on application startup, we don't have a state currently. // In some cases it might make sense to pass this initial state. // Another approach: When doing "auto-save", register for recovery everytime, and pass // the current state I.E. data for recovery at that time. RecoveryData data = new RecoveryData(new RecoveryCallback(RecoveryProcedure), null); RecoverySettings settings = new RecoverySettings(data, 0); ApplicationRestartRecoveryManager.RegisterForApplicationRecovery(settings); }
public static void RegisterForRecovery() { // Since this registration is being done on application startup, we don't have a state currently. // In some cases it might make sense to pass this initial state. // Another approach: When doing "auto-save", register for recovery everytime, and pass // the current state I.E. data for recovery at that time. RecoveryData data = new RecoveryData(RecoveryProcedure, null); RecoverySettings settings = new RecoverySettings(data, 0); RegisterForApplicationRecovery(settings); }
private static UInt32 InternalRecoveryHandler(IntPtr parameter) { bool cancelled = false; ApplicationRecoveryInProgress(out cancelled); GCHandle handle = GCHandle.FromIntPtr(parameter); RecoveryData data = handle.Target as RecoveryData; data.Invoke(); handle.Free(); return(0); }
/// <summary> /// Initializes a new instance of the RecoverySettings class. /// </summary> /// <param name="data">A recovery data object that contains the callback method (invoked by the system /// before Windows Error Reporting terminates the application) and an optional state object.</param> /// <param name="interval">The time interval within which the /// callback method must invoke ApplicationRestartRecoveryManager.ApplicationRecoveryInProgress to /// prevent WER from terminating the application.</param> public RecoverySettings(RecoveryData data, uint interval) { this.recoveryData = data; this.pingInterval = interval; }
/// <summary> /// Initializes a new instance of the RecoverySettings class. /// </summary> /// <param name="data">A recovery data object that contains the callback method (invoked by the system /// before Windows Error Reporting terminates the application) and an optional state object.</param> /// <param name="interval">The time interval within which the /// callback method must invoke ApplicationRestartRecoveryManager.ApplicationRecoveryInProgress to /// prevent WER from terminating the application.</param> public RecoverySettings(RecoveryData data, uint interval) { this.recoveryData = data; this.pingInterval = interval; }
public static void RegisterForRecovery() { RecoveryData data = new RecoveryData(new RecoveryCallback(RecoveryProcedure), null); RecoverySettings settings = new RecoverySettings(data, 0); ApplicationRestartRecoveryManager.RegisterForApplicationRecovery(settings); }