예제 #1
0
 public static void ShowErrorDialog(Control owner, string message, Exception exception) {
   if (owner == null) throw new ArgumentNullException("owner");
   if (owner.InvokeRequired) {
     owner.Invoke(new Action<Control, string, Exception>(ShowErrorDialog), owner, message, exception);
   } else {
     using (ErrorDialog dialog = new ErrorDialog(message, exception)) {
       dialog.ShowDialog(owner);
     }
   }
 }
예제 #2
0
 public static void ShowErrorDialog(string message, Exception exception) {
   using (ErrorDialog dialog = new ErrorDialog(message, exception)) {
     dialog.StartPosition = FormStartPosition.CenterScreen;
     dialog.ShowDialog();
   }
 }