private void htmlEditorControl_HtmlException(object sender, MSDN.Html.Editor.HtmlExceptionEventArgs args) { // obtain the message and operation // concatenate the message with any inner message string operation = args.Operation; Exception ex = args.ExceptionObject; string message = ex.Message; if (ex.InnerException != null) { if (ex.InnerException.Message != null) { message = string.Format("{0}\n{1}", message, ex.InnerException.Message); } } // define the title for the internal message box string title; if (operation == null || operation == string.Empty) { title = "Unknown Error"; } else { title = operation + " Error"; } // display the error message box MessageBox.Show(this, message, title, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); }
/// <summary> /// Method to raise an event if a delegeate is assigned for handling exceptions /// </summary> private void OnHtmlException(HtmlExceptionEventArgs args) { if (HtmlException == null) { // obtain the message and operation // concatenate the message with any inner message string operation = args.Operation; Exception ex = args.ExceptionObject; string message = ex.Message; if (ex.InnerException != null) { if (ex.InnerException.Message != null) { message = string.Format("{0}\n{1}", message, ex.InnerException.Message); } } // define the title for the internal message box string title; if (operation == null || operation == string.Empty) { title = "Unknown Error"; } else { title = operation + " Error"; } // display the error message box MessageBox.Show(this, message, title, MessageBoxButtons.OK, MessageBoxIcon.Error); } else { HtmlException(this, args); } }