/// <summary> /// Get a reference to the form proxy singleton. /// </summary> /// <returns>A reference to the form proxy.</returns> public static ErrorFormProxy GetInstance() { if (_singleton == null) { _singleton = new ErrorFormProxy(); } return(_singleton); }
/// <summary> /// Create an instance of the form to display the details of an exception. /// </summary> /// <param name="ex">The exception to display in the form.</param> /// <param name="allowContinue">Allow the application to continue once /// the error form has been closed. Set to false to force the application /// to exit.</param> public ErrorForm(Exception ex, bool allowContinue) { InitializeComponent(); if (!allowContinue) { _btnContinue.Enabled = false; } _errorMessageLabel.Text = ex.Message; _stackTraceTextBox.Text = ex.StackTrace; // Allow client applications to modify the form. ErrorFormProxy.GetInstance().UpdateFormControls(Controls); }