Exemplo n.º 1
0
        /// <summary>
        /// Called when a message needs to be notified to the consumer
        /// </summary>
        /// <param name="message"></param>
        private void RaiseBatchMessage(string message)
        {
            Validate.IsNotNullOrEmptyString(nameof(message), message);

            if (batchEventHandlers != null)
            {
                BatchMessageEventArgs args = new BatchMessageEventArgs(message);
                batchEventHandlers.OnBatchMessage(this, args);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called when a message came from SqlClient
        /// </summary>
        /// <remarks>
        /// Additionally, it's being used to notify the user that the script execution
        /// has been finished.
        /// </remarks>
        /// <param name="detailedMessage"></param>
        /// <param name="message"></param>
        private void RaiseBatchMessage(string detailedMessage, string message, SqlError error)
        {
            EventHandler <BatchMessageEventArgs> cache = BatchMessage;

            if (cache != null)
            {
                BatchMessageEventArgs args = new BatchMessageEventArgs(detailedMessage, message, error);
                cache(this, args);
            }
        }