Exemple #1
0
 protected void AttachSubscriber(Transactions.Processes.Base process, Engine.ErrorDelegate onError)
 {
     process.OnError += delegate(Transactions.Processes.Base sender, Transactions.Tasks.Base task, string message, Exception exception)
     {
         try
         {
             if (onError != null &&
                 !_isEventSubscriptionSuppressed)
             {
                 onError(_request, message, exception);
             }
         }
         catch (System.Exception e)
         {
             Logger.Storage.Error("An exception occurred while calling the method specified in the onError argument.", e);
             throw;
         }
     };
 }
Exemple #2
0
        // Protected Methods (6) 

        protected void AttachSubscriber(Transactions.Processes.Base process, Engine.ActionDelegate onAction)
        {
            process.OnActionChanged += delegate(Transactions.Processes.Base sender, Transactions.Tasks.Base task, EngineActionType actionType, bool willSendProgress)
            {
                try
                {
                    if (onAction != null &&
                        !_isEventSubscriptionSuppressed)
                    {
                        onAction(_request, actionType, willSendProgress);
                    }
                }
                catch (System.Exception e)
                {
                    Logger.Storage.Error("An exception occurred while calling the method specified in the onAction argument.", e);
                    throw;
                }
            };
        }
Exemple #3
0
 protected void AttachSubscriber(Transactions.Processes.Base process, Engine.CompletionDelegate onComplete)
 {
     process.OnComplete += delegate(Transactions.Processes.Base sender, ICommandReply reply, object result)
     {
         try
         {
             if (onComplete != null &&
                 !_isEventSubscriptionSuppressed)
             {
                 onComplete(_request, reply, result);
             }
         }
         catch (System.Exception e)
         {
             Logger.Storage.Error("An exception occurred while calling the method specified in the onComplete argument.", e);
             throw;
         }
     };
 }
Exemple #4
0
 protected void AttachSubscriber(Transactions.Processes.Base process, Engine.ProgressDelegate onProgress)
 {
     process.OnProgress += delegate(Transactions.Processes.Base sender, Transactions.Tasks.Base task, OpenDMS.Networking.Protocols.Tcp.DirectionType direction, int packetSize, decimal sendPercentComplete, decimal receivePercentComplete)
     {
         try
         {
             if (onProgress != null &&
                 !_isEventSubscriptionSuppressed)
             {
                 onProgress(_request, direction, packetSize, sendPercentComplete, receivePercentComplete);
             }
         }
         catch (System.Exception e)
         {
             Logger.Storage.Error("An exception occurred while calling the method specified in the onProgress argument.", e);
             throw;
         }
     };
 }