source: BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/IHS BMX Framework/IndianHealthService.BMXNet.WinForm/Forms/ExceptionMessageDialog.cs@ 1146

Last change on this file since 1146 was 1146, checked in by Sam Habiel, 13 years ago

Initial Import of BMX4

File size: 2.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Text;
7using System.Windows.Forms;
8
9namespace IndianHealthService.BMXNet.WinForm.Forms
10{
11 internal partial class ExceptionMessageDialog : System.Windows.Forms.Form
12 {
13 public ExceptionMessageDialog()
14 {
15 InitializeComponent();
16 }
17
18 private Exception _problem = null;
19
20 public Exception Problem
21 {
22 get { return _problem; }
23 set { _problem = value; }
24 }
25
26
27 private void CfShowExceptionDialog_Load(object sender, EventArgs e)
28 {
29 //this.Problem.Data
30 //this.Problem.InnerException
31 //this.Problem.Message
32 //this.Problem.Source
33 //this.Problem.StackTrace
34 this.stackTraceTextBox.Text = this.Problem.StackTrace;
35 this.exceptionTextBox.Text = this.Problem.Message;
36
37 this.innerExceptionButton.Enabled = this.Problem.InnerException != null;
38
39 }
40
41 private void copyButton_Click(object sender, EventArgs e)
42 {
43
44 }
45
46 private void innerExceptionButton_Click(object sender, EventArgs e)
47 {
48 ExceptionMessageDialog.SafeShow(this.Text, this.Problem.InnerException);
49
50 }
51 internal static void MessageBox(string aTitle, string aBody, Exception anException)
52 {
53 //Show a message box with "Details..." buttons
54
55 if (anException == null)
56 return;
57
58 ExceptionMessageDialog dialog = new ExceptionMessageDialog();
59 dialog.Text = aTitle ?? dialog.Text;
60 dialog.Problem = anException;
61 dialog.ShowDialog();
62 }
63
64 internal static void SafeShow(string aTitle, Exception anException)
65 {
66 if (anException == null)
67 return;
68
69 ExceptionMessageDialog dialog = new ExceptionMessageDialog();
70 dialog.Text = aTitle ?? dialog.Text;
71 dialog.Problem = anException;
72 dialog.ShowDialog();
73 }
74 }
75}
Note: See TracBrowser for help on using the repository browser.