//-------------------------------------------------------------------------------
 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);
     }
 }
Пример #2
0
        //------------------------------------------------------------------------
        //  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;
        }
Пример #3
0
        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;
                }
            }
        }
Пример #4
0
 //-------------------------------------------------------------------------------
 private void ShowError(Exception exp)
 {
     FormErrorHandler.Show(this, exp, m_strLink);
 }