コード例 #1
0
        /// <summary>
        /// Logs an exception, displays a message to the user,
        /// and reverts the cursor if neccessary.
        /// </dsummary>
        public void HandleException(string userErrorMessage, Exception exception)
        {
            this.Cursor = Cursors.Default;

#if DEBUG
#else
            // log error to event log
            EventLogHelper.LogError(userErrorMessage, exception);
#endif

            userErrorMessage += Environment.NewLine
                                + Environment.NewLine
                                + exception.ToString();

#if DEBUG
            // show extended error message in debug mode
            userErrorMessage += Environment.NewLine
                                + Environment.NewLine
                                + exception.StackTrace;
#endif

            try
            {
                MessageBoxHelper.ShowError(userErrorMessage);
            }
            catch
            { }
        }
コード例 #2
0
        /// <summary>
        /// Logs an exception, displays a message to the user,
        /// and reverts the cursor if neccessary.
        /// </summary>
        public void HandleException(Exception exception)
        {
            this.Cursor = Cursors.Default;
            MessageBoxHelper.ShowError(exception);

#if DEBUG
#else
            // log error to event log
            EventLogHelper.LogError(exception);
#endif
        }
コード例 #3
0
 /// <summary>
 /// Logs an exception, displays a message to the user,
 /// and reverts the cursor if neccessary.
 /// </summary>
 public static void HandleException(Exception exception)
 {
     // log error to event log
     EventLogHelper.LogError(exception);
 }
コード例 #4
0
 /// <summary>
 /// Logs an exception, displays a message to the user,
 /// and reverts the cursor if neccessary.
 /// </dsummary>
 public static void HandleException(string userErrorMessage, Exception exception)
 {
     // log error to event log
     EventLogHelper.LogError(userErrorMessage, exception);
 }