private bool _hasProvidedCrashFeedback;
private void CurrentDomainOnFirstChanceException(object sender, FirstChanceExceptionEventArgs e) =>
HandleException(e.Exception);
protected override void OnUnhandledException(DispatcherUnhandledExceptionEventArgs e) =>
HandleException(e.Exception);
private void HandleException(Exception e)
{
_log.Fatal(e, "");
if (_hasProvidedCrashFeedback) return;
_hasProvidedCrashFeedback = true;
Dispose(); // this call doubles the time the window hangs around
MessageBox.Show("See C:\\Users\\USERNAME\\AppData\\Roaming\\F1Desktop\\Logs for technical information.",
"F1 Desktop Has Crashed Unexpectedly");
}
public override void Dispose()
{
GC.SuppressFinalize(this);
_icon.Dispose();
JobManager.Stop();
base.Dispose();
}
private bool _hasProvidedCrashFeedback;
private void CurrentDomainOnFirstChanceException(object sender, FirstChanceExceptionEventArgs e) =>
HandleException(e.Exception);
protected override void OnUnhandledException(DispatcherUnhandledExceptionEventArgs e) =>
HandleException(e.Exception);
private void HandleException(Exception e)
{
_log.Fatal(e, "");
if (_hasProvidedCrashFeedback) return;
_hasProvidedCrashFeedback = true;
Dispose(); // this call doubles the time the window hangs around
MessageBox.Show("See C:\\Users\\USERNAME\\AppData\\Roaming\\F1Desktop\\Logs for technical information.",
"F1 Desktop Has Crashed Unexpectedly");
}
public override void Dispose()
{
GC.SuppressFinalize(this);
_icon.Dispose();
JobManager.Stop();
base.Dispose();
}