Snoop.SnoopUI.UnhandledExceptionHandler C# (CSharp) Method

UnhandledExceptionHandler() private method

private UnhandledExceptionHandler ( object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e ) : void
sender object
e System.Windows.Threading.DispatcherUnhandledExceptionEventArgs
return void
        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;
        }