/// <summary>
        /// All other factory methods will result in a call to this one.
        /// </summary>
        ///
        /// <param name="message">The message to display.</param>
        /// <param name="exception">The exception to display.</param>
        /// <param name="handlingInstanceID">The handling instance ID</param>
        /// <param name="redirectToErrorPageOnClose">Flag that specifies if the application should redirect to the error page when closed.</param>
        public static ErrorWindow CreateNew(string message, Exception exception, Guid handlingInstanceID, bool redirectToErrorPageOnClose)
        {
            ErrorWindow window = new ErrorWindow(message, exception, handlingInstanceID);

            if (redirectToErrorPageOnClose)
            {
                window.Closed += delegate { RedirectFromErrorWindow(); };
            }


            window.Show();
            return(window);
        }
        /// <summary>
        /// All other factory methods will result in a call to this one
        /// </summary>
        ///
        /// <param name="message">Which message to display</param>
        /// <param name="stackTrace">The associated stack trace</param>
        /// <param name="policy">In which situations the stack trace should be appended to the message</param>
        private static void CreateNew(string message, string stackTrace, StackTracePolicy policy)
        {
            string errorDetails = string.Empty;

            if (policy == StackTracePolicy.Always ||
                policy == StackTracePolicy.OnlyWhenDebuggingOrRunningLocally && IsRunningUnderDebugOrLocalhost)
            {
                errorDetails = stackTrace ?? string.Empty;
            }

            ErrorWindow window = new ErrorWindow(message, errorDetails);

            window.Show();
        }