public ExceptionHandlingContext(Exception e, string contextualMessage, IDesktopWindow desktopWindow, AbortOperationDelegate abortOperationDelegate) { _exception = e; ContextualMessage = contextualMessage; DesktopWindow = desktopWindow; _abortDelegate = abortOperationDelegate; }
/// <summary> /// Reports the specified exception to the user, displaying the specified user message first. /// </summary> /// <remarks> /// The exception is also automatically logged. /// </remarks> /// <param name="e">Exception to report.</param> /// <param name="contextualMessage">User-friendly (contextual) message to display, instead of the message contained in the exception.</param> /// <param name="desktopWindow">Desktop window that parents the exception dialog.</param> /// <param name="abortDelegate">A callback delegate for aborting the exception-causing operation. Decision as to whether or /// not the callback is called is up to the individual <see cref="IExceptionPolicy"/>.</param> public static void Report(Exception e, [param : Localizable(true)] string contextualMessage, IDesktopWindow desktopWindow, AbortOperationDelegate abortDelegate) { ExceptionPolicyFactory.GetPolicy(e.GetType()). Handle(e, new ExceptionHandlingContext(e, contextualMessage, desktopWindow, abortDelegate)); }
/// <summary> /// Reports the specified exception to the user, displaying the specified user message first. /// </summary> /// <remarks> /// The exception is also automatically logged. /// </remarks> /// <param name="e">Exception to report.</param> /// <param name="contextualMessage">User-friendly (contextual) message to display, instead of the message contained in the exception.</param> /// <param name="desktopWindow">Desktop window that parents the exception dialog.</param> /// <param name="abortDelegate">A callback delegate for aborting the exception-causing operation. Decision as to whether or /// not the callback is called is up to the individual <see cref="IExceptionPolicy"/>.</param> public static void Report(Exception e, string contextualMessage, IDesktopWindow desktopWindow, AbortOperationDelegate abortDelegate) { ExceptionPolicyFactory.GetPolicy(e.GetType()). Handle(e, new ExceptionHandlingContext(e, contextualMessage, desktopWindow, abortDelegate)); }