//Except where stated all code and programs in this project are the copyright of Jim Blackler, 2008. //jimblackler@gmail.com // //This is free software. Libraries and programs are distributed under the terms of the GNU Lesser //General Public License. Please see the files COPYING and COPYING.LESSER. using System; using System.Windows.Forms; namespace JimBlackler.ExceptionDialog { /// /// A dialog listing full technical information about an exception /// public partial class AdvancedExceptionDialog : Form { /// /// Create an advanced exception dialog /// public AdvancedExceptionDialog() { InitializeComponent(); } /// /// Create an advanced exception dialog /// /// The exception to describe public AdvancedExceptionDialog(Exception exception) { InitializeComponent(); Exception = exception; } /// /// The exception described by the dialog /// public Exception Exception { get { return exception; } set { exception = value; messageTextBox.Text = exception.Message; stackTraceTextBox.Text = exception.StackTrace; viewInnerExceptionButton.Visible = (Exception.InnerException != null); } } private Exception exception; /// /// The user pressed the Close button /// private void closeButton_Click(object sender, EventArgs e) { Close(); } /// /// The user pressed the 'Inner Exception' button /// private void button1_Click(object sender, EventArgs e) { AdvancedExceptionDialog advancedExceptionDialog = new AdvancedExceptionDialog(); advancedExceptionDialog.Exception = Exception.InnerException; advancedExceptionDialog.ShowDialog(); } } }