//-------------------------------------------------------------------------------
 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);
     }
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
                }
            }
        }
Ejemplo n.º 4
0
 //-------------------------------------------------------------------------------
 private void ShowError(Exception exp)
 {
     FormErrorHandler.Show(this, exp, m_strLink);
 }