MermaidErrorEventArgs
Namespace: Wisej.Web.Ext.Mermaid
Assembly: Wisej.Web.Ext.Mermaid (4.1.0.0)
Provides data for the Error event.
- C#
- VB.NET
public class MermaidErrorEventArgs : EventArgs
Public Class MermaidErrorEventArgs
Inherits EventArgs
This type is raised when Mermaid reports a client-side validation/parsing error.
Example:
mermaid.Error += (s, e) =>
{
// Inspect error details provided by the client, if any.
System.Diagnostics.Debug.WriteLine(e.Message);
System.Diagnostics.Debug.WriteLine(e.Error);
};
Constructors
MermaidErrorEventArgs(message, error)
Initializes a new instance of the MermaidErrorEventArgs class.
| Name | Type | Description |
|---|---|---|
| message | String | Human-readable error message. |
| error | Object | Optional raw error payload from the browser. |
Example:
Raising the event from a derived control:
var args = new Wisej.Web.Ext.Mermaid.MermaidErrorEventArgs("Invalid diagram.");
Properties
Error
Object: Returns the optional error payload sent from the browser (typically a JSON-serializable object), or null.
This value is passed through as-is and may be an anonymous JSON-like object.
Example:
Inspecting the raw error payload:
mermaid.Error += (s, e) =>
{
// In many cases this will be a JSON object with Mermaid-specific fields.
var raw = e.Error;
};
Message
String: Returns the human-readable error message.
When raised by the Mermaid widget, this is the message of the Mermaid parser error, or "Invalid Mermaid diagram." when the browser didn't provide one.
Example:
Showing the error to the user:
mermaid.Error += (s, e) => Wisej.Web.MessageBox.Show(e.Message);
Used By
| Name | Description |
|---|---|
| MermaidErrorEventHandler | Represents the method that will handle the Error event in a Mermaid control. |