コード例 #1
0
        /// <summary>
        /// Raises the <see cref="E:Warning"/> event.
        /// </summary>
        /// <param name="warning">
        /// The instance containing the event data.
        /// </param>
        internal void OnWarning(HsqlWarningEventArgs warning)
        {
            HsqlWarningEventHandler handler = this.Warning;

            if (handler == null)
            {
                HsqlConnection connection = this.Connection;

                if (connection != null)
                {
                    connection.OnWarning(warning);
                }
            }
            else
            {
                try
                {
                    handler(this, warning);
                }
                catch (Exception ex)
                {
                    if (HsqlDiagnostics.MustRethrowEventProcessingException(ex))
                    {
                        throw;
                    }
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Raises the <see cref="E:Warning"/> event.
        /// </summary>
        /// <param name="warning">
        /// The instance containing the event data.
        /// </param>
        internal void OnWarning(HsqlWarningEventArgs warning)
        {
            HsqlWarningEventHandler handler = this.Warning;

            if (handler != null)
            {
                try
                {
                    handler.Invoke(this, warning);
                }
                catch (Exception ex)
                {
                    if (HsqlDiagnostics.MustRethrowEventProcessingException(ex))
                    {
                        throw;
                    }
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Invoked upon statement completion to notify any parties that
        /// have registered an insterest in the
        /// <see cref="StatementCompleted"/> event.
        /// </summary>
        /// <param name="recordCount">
        /// The number of records affected by executing the statement;
        /// a value less than zero causes the notification to be skipped.
        /// </param>
        internal void OnStatementCompleted(int recordCount)
        {
            if (0 <= recordCount)
            {
                StatementCompletedEventHandler handler = this.StatementCompleted;

                if (handler != null)
                {
                    try
                    {
                        handler(this, new StatementCompletedEventArgs(recordCount));
                    }
                    catch (Exception ex)
                    {
                        if (HsqlDiagnostics.MustRethrowEventProcessingException(ex))
                        {
                            throw;
                        }
                    }
                }
            }
        }
コード例 #4
0
        /// <summary>
        /// Sets the state of this <c>HsqlConnection</c>.
        /// </summary>
        /// <param name="newState">The new state.</param>
        internal void SetStateInternal(ConnectionState newState)
        {
            ConnectionState oldState = m_connectionState;

            if (newState == oldState)
            {
                return;
            }

            m_connectionState = newState;

            try
            {
                base.OnStateChange(new StateChangeEventArgs(oldState, newState));
            }
            catch (Exception ex)
            {
                if (HsqlDiagnostics.MustRethrowEventProcessingException(ex))
                {
                    throw;
                }
            }
        }