コード例 #1
0
ファイル: HTMLEditor.cs プロジェクト: InternationalIDEA/ERMT
        private void htmlEditorControl_HtmlException(object sender, Microsoft.ConsultingServices.HtmlEditor.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);
        }
コード例 #2
0
ファイル: HtmlEditorControl.cs プロジェクト: Brinews/Code
 // method to raise an event if a delegeate is assigned
 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);
     }
 }