private void UnhandledExceptionHandler(object sender, DispatcherUnhandledExceptionEventArgs e)
{
if (SnoopModes.IgnoreExceptions)
{
return;
}
if (SnoopModes.SwallowExceptions)
{
e.Handled = true;
return;
}
// should we check if the exception came from Snoop? perhaps seeing if any Snoop call is in the stack trace?
ErrorDialog dialog = new ErrorDialog();
dialog.Exception = e.Exception;
var result = dialog.ShowDialog();
if (result.HasValue && result.Value)
e.Handled = true;
}