예제 #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);
 }