public ReportErrorDlg(Exception e, ReportChoice reportChoice) { _exception = e ?? new Exception("Unknown exception"); InitializeComponent(); //Icon = Resources.Skyline; tbErrorDescription.Text = replaceNewlines(e.Message); tbSourceCodeLocation.Text = StackTraceText; tbUsername.Text = getUserDisplayName(); if (reportChoice != ReportChoice.choice) { btnOK.Visible = false; btnOK.DialogResult = DialogResult.Cancel; btnCancel.Text = "Close"; if (reportChoice == ReportChoice.always) { btnCancel.DialogResult = DialogResult.OK; } AcceptButton = btnCancel; StringBuilder error = new StringBuilder("An unexpected error has occurred, as shown below."); if (reportChoice == ReportChoice.always) { error.AppendLine().Append("An error report will be posted."); } lblReportError.Text = error.ToString(); } }
public ReportErrorDlg (Exception e, ReportChoice reportChoice) { _exception = e ?? new Exception("Unknown exception"); InitializeComponent(); //Icon = Resources.Skyline; tbErrorDescription.Text = replaceNewlines(e.Message); tbSourceCodeLocation.Text = StackTraceText; tbUsername.Text = getUserDisplayName(); if (reportChoice != ReportChoice.choice) { btnOK.Visible = false; btnOK.DialogResult = DialogResult.Cancel; btnCancel.Text = "Close"; if (reportChoice == ReportChoice.always) btnCancel.DialogResult = DialogResult.OK; AcceptButton = btnCancel; StringBuilder error = new StringBuilder("An unexpected error has occurred, as shown below."); if (reportChoice == ReportChoice.always) error.AppendLine().Append("An error report will be posted."); lblReportError.Text = error.ToString(); } }