Esempio n. 1
0
    protected override void OnExecutionTokenPrepared(ExecutionTokenPreparedEventArgs e)
    {
        if (e == null)
        {
            throw new ArgumentNullException(nameof(e), $"{nameof(e)} is null.");
        }

        var token = e.ExecutionToken as SqlServerCommandExecutionToken;

        if (token == null)
        {
            throw new NotSupportedException($"This type of command builder does not support SQL Dependency, which is required for the {nameof(NotifyChangeAppender<TResult>)}.");
        }
        token.AddChangeListener(m_EventHandler);
    }
Esempio n. 2
0
 /// <summary>
 /// Override this if you want to examine or modify the execution token before the DBCommand object is built.
 /// </summary>
 /// <param name="e">The <see cref="ExecutionTokenPreparedEventArgs"/> instance containing the event data.</param>
 protected virtual void OnExecutionTokenPrepared(ExecutionTokenPreparedEventArgs e)
 {
 }
Esempio n. 3
0
 void PreviousLink_ExecutionTokenPrepared(object?sender, ExecutionTokenPreparedEventArgs e)
 {
     OnExecutionTokenPrepared(e);             //left first
     ExecutionTokenPrepared?.Invoke(this, e); //then right
     e.ExecutionToken.CommandBuilt += ExecutionToken_CommandBuilt;
 }
Esempio n. 4
0
 /// <summary>
 /// Raises the <see cref="ExecutionTokenPrepared" /> event.
 /// </summary>
 /// <param name="e">The <see cref="ExecutionTokenPreparedEventArgs"/> instance containing the event data.</param>
 protected void OnExecutionTokenPrepared(ExecutionTokenPreparedEventArgs e)
 {
     ExecutionTokenPrepared?.Invoke(this, e);
 }
Esempio n. 5
0
 void OnExecutionTokenPrepared(object?sender, ExecutionTokenPreparedEventArgs e)
 {
     ExecutionTokenPrepared?.Invoke(sender, e);
 }