TransactionalNodeService.Soap.TransactionFramework.UpdateNodeTransactionLink.OnUpdateNodeCompleted C# (CSharp) Method

OnUpdateNodeCompleted() private method

private OnUpdateNodeCompleted ( object sender, Service e ) : void
sender object
e Service
return void
        private void OnUpdateNodeCompleted(object sender, Service.NUCompletedEventArgs e)
        {
            if (e.UserState != this)
            {
                // This event is for a different object so don't execute.
                return;
            }

            // The following lines must be done so that the transaction isn't executed again.
            ServiceProxy.NUCompleted -= OnUpdateNodeCompleted;

            if (e.Error != null)
            {
                Service.CompleteTransactionCompletedEventArgs completedEventArgs = new Service.CompleteTransactionCompletedEventArgs(null, e.Error, false, null);

                if (InternalTransactionCompleted != null)
                {
                    InternalTransactionCompleted(this, completedEventArgs);
                }

                return;
            }

            ResponseParameter = e.Result;

            ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor;

            if (executor == null)
            {
                DebugLogger.Instance.LogMsg("Exception: This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor.");
                throw new NotSupportedException("This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor.");
            }

            if (!_onCompletedBound)
            {
                executor.TransactionFailed += OnTransactionFailed;
                executor.TransactionCompleted += OnTransactionCompleted;

                _onCompletedBound = true;
            }

            DebugLogger.Instance.LogMsg("Executing update node transaction. ResponseParameter Id - '{0}'; NodeId - '{1}'; NodeTypeName - '{2}'", ResponseParameter.I, Node.Id, NodeType.Name);
            executor.ExecuteTransaction(SessionId, ServiceProxy);
        }