[]
Occurs when an error occurs within the viewer. This event provides detailed information about the error, allowing for custom error handling or logging.
public event EventHandler<ErrorInfo> ErrorOccured
Type | Description |
---|---|
EventHandler<ErrorInfo> | Occurs when an error occurs within the viewer. This event provides detailed information about the error, allowing for custom error handling or logging. |
The ErrorInfo object passed as a parameter to the event handler contains details about the error, including the exception object, a user-friendly message, and potentially other metadata related to the error condition.
viewer.ErrorOccured += (sender, e) =>
{
// Log error details
Console.WriteLine($"Error: {e.Exception.Message}");
// Show a user-friendly message
MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
};