void OnSubmitBulkOperationCompleted(object sender, Service.BOCCompletedEventArgs 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.BOCCompleted -= OnSubmitBulkOperationCompleted;
if (e.Error != null)
{
TransactionStatus = ServerStatus.TransactionFailed;
if (InternalTransactionFailed != null)
{
InternalTransactionFailed(this, e);
}
return;
}
OriginChain.FillBulkOperations(e.DecompressedResult);
Service.OPS newBulkOperationsSet = new Service.OPS();
newBulkOperationsSet.O = new System.Collections.ObjectModel.ObservableCollection<object>();
ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor;
if (!_onCompletedBound)
{
executor.TransactionFailed += OnTransactionFailed;
executor.TransactionCompleted += OnTransactionCompleted;
_onCompletedBound = true;
}
DebugLogger.Instance.LogMsg("Executing update metadata transaction. ResponseParameter Id - '{0}'; Name - '{1}'; Value - '{2}'; MetadataId - '{3}'", ResponseParameter.I, Name, Value, Metadata.Id);
executor.ExecuteBulkTransactions(SessionId, ServiceProxy, ref newBulkOperationsSet);
}