//////////////////////////////////////////////////////////////////// // Other example //////////////////////////////////////////////////////////////////// private void OnOtherExample ( object sender, EventArgs e ) { ExceptionReport.Wrap("PDF Document creation falied", delegate { OtherExample OE = new OtherExample(); OE.Test(DebugCheckBox.Checked, "OtherExample.pdf"); return; }); }
//////////////////////////////////////////////////////////////////// // Other example //////////////////////////////////////////////////////////////////// private void OnOtherExample ( object sender, EventArgs e ) { try { OtherExample OE = new OtherExample(); OE.Test(DebugCheckBox.Checked, "OtherExample.pdf"); return; } catch (Exception Ex) { // error exit String[] ExceptionStack = ExceptionReport.GetMessageAndStack(Ex); MessageBox.Show(this, "PDF Document creation falied\n" + ExceptionStack[0] + "\n" + ExceptionStack[1], "PDFDocument Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } }
static void Main(string[] args) { var p = new OtherExample(); p.Test(false, @"C:\Test\sample6y.pdf"); }