Class LogDialog
- Namespace
- VisioForge.Core.UI.WinForms.Dialogs
- Assembly
- VisioForge.Core.dll
A Windows Forms dialog for displaying error messages and log entries. This dialog is shown when the OnError event is not implemented in client code, providing a default error display mechanism for the VisioForge media framework.
public class LogDialog : Form, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControlInheritance
Implements
Inherited Members
Extension Methods
Remarks
The LogDialog serves as a fallback error display when applications don't implement proper error handling. It provides:
- Thread-safe log message appending
- Instructional text explaining the need for proper error handling
- Simple log clearing functionality Applications should implement the OnError event to handle errors properly instead of relying on this dialog.
Constructors
LogDialog()
Initializes a new instance of the VisioForge.Core.UI.WinForms.Dialogs.LogDialog class. Creates a new log dialog with default UI components initialized.
public LogDialog()Remarks
This constructor calls InitializeComponent() to set up the UI elements including the instructional text and log display area.
Methods
AddToLog(ErrorsEventArgs)
Adds an error message to the log display using event arguments. Safely appends the error message to the log text box using thread-safe invoke if necessary.
public void AddToLog(ErrorsEventArgs args)Parameters
argsErrorsEventArgs-
The error event arguments containing the message to log.
Remarks
This method is thread-safe and will invoke the UI update on the correct thread if called from a background thread. The error message is appended with a newline to maintain proper formatting in the log display.
AddToLog(string)
Adds a message to the log display. Safely appends the message to the log text box using thread-safe invoke if necessary.
public void AddToLog(string message)Parameters
messagestring-
The message to add to the log.
Remarks
This method is thread-safe and will invoke the UI update on the correct thread if called from a background thread. The message is appended with a newline to maintain proper formatting in the log display.
ClearLog()
Clears all messages from the log display. Safely clears the log text box content using thread-safe invoke if necessary.
public void ClearLog()Remarks
This method is thread-safe and will invoke the UI update on the correct thread if called from a background thread. After clearing, the log display will be empty.
Dispose(bool)
Clean up any resources being used by the log dialog. Disposes of managed resources including UI components when disposing is true.
protected override void Dispose(bool disposing)Parameters
disposingbool-
true if managed resources should be disposed; otherwise, false.
Remarks
This method is called by the Dispose() method and the finalizer. When disposing is true, it's safe to dispose of managed resources.