//------------------------------------------------------------------------------- private void buttonErrorHandlerForm_Click(object sender, EventArgs e) { try { CreateError(); // Throw an error to test FormErrorHandler form } catch (Exception exp) { FormErrorHandler.Show(this, exp, _stringWebsiteErr); } }
//------------------------------------------------------------------------ // Constructors and Initializers //------------------------------------------------------------------------ public DatabaseService(FormErrorHandler error, FormInfoHandler info) { connection = new OleDbConnection(); connectionStringService = new ConnectionStringService(); connection.ConnectionString = connectionStringService.buildConnectionString(); connection.Open(); OnFormError += error; OnFormInfo += info; }
public void removeSubscription() { FormErrorHandler handlerError = OnFormError; if (handlerError != null) { foreach (Delegate d in handlerError.GetInvocationList()) { handlerError -= (FormErrorHandler)d; } } FormInfoHandler handlerInfo = OnFormInfo; if (handlerInfo != null) { foreach (Delegate d in handlerInfo.GetInvocationList()) { handlerInfo -= (FormInfoHandler)d; } } }
//------------------------------------------------------------------------------- private void ShowError(Exception exp) { FormErrorHandler.Show(this, exp, m_strLink); }