OSDN Git Service

AppliAppliStation-GUI,例外表示ダイアログ部分で例外が発生したときの対策。
authorttp <ttp@users.sourceforge.jp>
Thu, 6 Mar 2008 08:18:04 +0000 (08:18 +0000)
committerttp <ttp@users.sourceforge.jp>
Thu, 6 Mar 2008 08:18:04 +0000 (08:18 +0000)
git-svn-id: http://localhost/svn/AppliStation/trunk@869 34ed2c89-c49f-4a4b-abdb-c318350108cf

AppliStation/AppliStation.Util/ExceptionDialogForm.cs

index 2d414d6..82bcec4 100644 (file)
@@ -19,19 +19,24 @@ namespace AppliStation.Util
                \r
                private static void Application_ThrowException(Exception e)\r
                {\r
-                       ExceptionDialogForm form = new ExceptionDialogForm();\r
-                       if (e != null) {\r
-                               form.detailTextBox.Text = e.ToString() + System.Environment.NewLine + e.StackTrace;\r
-                       } else {\r
-                               form.viewDetailButton.Visible = false;\r
-                       }\r
-                       \r
-                       switch (form.ShowDialog()) {\r
-                               case DialogResult.Cancel:\r
-                                       return;\r
-                               default:\r
-                                       Application.Exit();\r
-                                       break;\r
+                       try {\r
+                               ExceptionDialogForm form = new ExceptionDialogForm();\r
+                               if (e != null) {\r
+                                       form.detailTextBox.Text = e.ToString() + System.Environment.NewLine + e.StackTrace;\r
+                               } else {\r
+                                       form.viewDetailButton.Visible = false;\r
+                               }\r
+                               \r
+                               switch (form.ShowDialog()) {\r
+                                       case DialogResult.Cancel:\r
+                                               return;\r
+                                       default:\r
+                                               Application.Exit();\r
+                                               break;\r
+                               }\r
+                       } catch {\r
+                               MessageBox.Show("\8fd\91å\82È\83G\83\89\81[\82ª\94­\90\82µ\82½\82Ì\82Å\8fI\97¹\82µ\82Ü\82·\81B\n" + e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                               Application.Exit();\r
                        }\r
                }\r
                \r