/// <summary>
 /// Displays the exception message box by filling the specified exception message
 /// into the form.
 /// </summary>
 /// <param name="_ex">The exception of which the message should be shown on the form.</param>
 /// <param name="_showSimple">Determines if it should show a detailed information. True for simple style, whereas false for the detailed style.</param>
 /// <returns>The dialog result of the message box.</returns>
 public static DialogResult ShowDialog(Exception _ex, bool _showSimple)
 {
     if (_ex != null)
     {
         ExceptionMessageBox messageBox = new ExceptionMessageBox();
         messageBox.txtMessage.Text = _ex.Message;
         if (_showSimple)
         {
             messageBox.detailGrid.SelectedObject = new SimpleExceptionMessage(_ex);
         }
         else
         {
             messageBox.detailGrid.SelectedObject = _ex;
         }
         return messageBox.ShowDialog();
     }
     return DialogResult.Cancel;
 }
Exemple #2
0
 /// <summary>
 /// Displays the exception message box by filling the specified exception message
 /// into the form.
 /// </summary>
 /// <param name="_ex">The exception of which the message should be shown on the form.</param>
 /// <param name="_showSimple">Determines if it should show a detailed information. True for simple style, whereas false for the detailed style.</param>
 /// <returns>The dialog result of the message box.</returns>
 public static DialogResult ShowDialog(Exception _ex, bool _showSimple)
 {
     if (_ex != null)
     {
         ExceptionMessageBox messageBox = new ExceptionMessageBox();
         messageBox.txtMessage.Text = _ex.Message;
         if (_showSimple)
         {
             messageBox.detailGrid.SelectedObject = new SimpleExceptionMessage(_ex);
         }
         else
         {
             messageBox.detailGrid.SelectedObject = _ex;
         }
         return(messageBox.ShowDialog());
     }
     return(DialogResult.Cancel);
 }