System.Transactions.Transaction.ISerializable C# (CSharp) Method

ISerializable() private method

private ISerializable ( SerializationInfo serializationInfo, StreamingContext context ) : void
serializationInfo SerializationInfo
context StreamingContext
return void
        void ISerializable.GetObjectData(
            SerializationInfo serializationInfo,
            StreamingContext context)
        {
            TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
            if (etwLog.IsEnabled())
            {
                etwLog.MethodEnter(TraceSourceType.TraceSourceLtm, this);
            }

            if (Disposed)
            {
                throw new ObjectDisposedException(nameof(Transaction));
            }

            if (serializationInfo == null)
            {
                throw new ArgumentNullException(nameof(serializationInfo));
            }

            if (_complete)
            {
                throw TransactionException.CreateTransactionCompletedException(DistributedTxId);
            }

            lock (_internalTransaction)
            {
                _internalTransaction.State.GetObjectData(_internalTransaction, serializationInfo, context);
            }

            if (etwLog.IsEnabled())
            {
                etwLog.TransactionSerialized(this, "Transaction");
                etwLog.MethodExit(TraceSourceType.TraceSourceLtm, this);
            }
        }