/// <summary> /// Event handler that occurs when an unhandled exception was catched in <see cref="MarginCore"/>. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">Event arguments.</param> private void OnMarginCoreExceptionThrown(object sender, ExceptionThrownEventArgs e) { if (!e.Handled) { ShowException(e.Exception); e.Handled = true; } }
/// <summary> /// Raises the <see cref="ExceptionThrown"/> event. /// </summary> /// <param name="exception">The exception that was thrown.</param> private void RaiseExceptionThrown(Exception exception) { var eventHandler = ExceptionThrown; var eventArgs = new ExceptionThrownEventArgs(exception); eventHandler?.Invoke(this, eventArgs); if (!eventArgs.Handled) { throw exception; } }
/// <summary> /// Raises the <see cref="ExceptionThrown"/> event. /// </summary> /// <param name="exception">The exception that was thrown.</param> private void RaiseExceptionThrown(Exception exception) { var eventHandler = ExceptionThrown; var eventArgs = new ExceptionThrownEventArgs(exception); if (eventHandler != null) { eventHandler(this, eventArgs); } if (!eventArgs.Handled) { throw exception; } }
/// <summary> /// Raises the <see cref="ExceptionThrown"/> event. /// </summary> /// <param name="exception">The exception that was thrown.</param> private void RaiseExceptionThrown(Exception exception) { var eventHandler = ExceptionThrown; var eventArgs = new ExceptionThrownEventArgs(exception); if (eventHandler != null) eventHandler(this, eventArgs); if (!eventArgs.Handled) throw exception; }