Snoop.SnoopUI.UnhandledExceptionHandler C# (CSharp) 메소드

UnhandledExceptionHandler() 개인적인 메소드

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