private void OnUpdateMetadataCompleted(object sender, Service.MUCompletedEventArgs 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.MUCompleted -= OnUpdateMetadataCompleted;
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 metadata transaction. ResponseParameter Id - '{0}'; Name - '{1}'; Value - '{2}'; MetadataId - '{3}'", ResponseParameter.I, Name, Value, Metadata.Id);
executor.ExecuteTransaction(SessionId, ServiceProxy);
}