System.Transactions.TransactionStatePromotedBase.GetObjectData C# (CSharp) Method

GetObjectData() private method

private GetObjectData ( InternalTransaction tx, SerializationInfo serializationInfo, StreamingContext context ) : void
tx InternalTransaction
serializationInfo System.Runtime.Serialization.SerializationInfo
context System.Runtime.Serialization.StreamingContext
return void
        internal override void GetObjectData(InternalTransaction tx, SerializationInfo serializationInfo, StreamingContext context)
        {
            Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction.");

            // This is not allowed if the transaction's PromoterType is not MSDTC.
            tx.ThrowIfPromoterTypeIsNotMSDTC();

            // Simply get call get object data for the promoted transaction.
            ISerializable serializableTx = tx.PromotedTransaction as ISerializable;
            if (serializableTx == null)
            {
                // The LTM can only support this if the Distributed TM Supports it.
                throw new NotSupportedException();
            }

            // Before forwarding this call to the promoted tx make sure to change
            // the full type info so that only if the promoted tx does not set this
            // then it should be set correctly.
            serializationInfo.FullTypeName = tx.PromotedTransaction.GetType().FullName;

            // Now forward the call.
            serializableTx.GetObjectData(serializationInfo, context);
        }