[]
Handles runtime errors by reporting them to the viewer's model for appropriate action.
public void HandleError(Exception ex)
Type | Name | Description |
---|---|---|
Exception | ex | The exception that occurred during runtime. This exception is passed to the viewer model for processing and potentially displaying an error message to the user. |
This method is intended to centralize error handling within the viewer control. It allows for a consistent approach to managing exceptions, such as logging errors or informing the user through the UI. The actual handling strategy is implemented within the viewer model.
// Instantiating the Viewer control and adding it to a form.
Viewer viewer = new Viewer();
viewer.Dock = DockStyle.Fill;
this.Controls.Add(viewer);
// Example of handling an error that might occur during document loading.
try
{
viewer.LoadDocument("path/to/your/report.rdlx");
}
catch (Exception ex)
{
viewer.HandleError(ex);
}