Xamarin Public Jenkins (auto-signing) e79aa3c0ed Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
2016-08-03 10:59:49 +00:00

58 lines
2.0 KiB
C#

//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace System.ServiceModel.Transactions
{
using System.Diagnostics.CodeAnalysis;
using System.Runtime;
using System.ServiceModel.Security;
using System.Transactions;
using Microsoft.Transactions.Wsat.Messaging;
class WsatTransactionInfo : TransactionInfo
{
WsatProxy wsatProxy;
CoordinationContext context;
RequestSecurityTokenResponse issuedToken;
public WsatTransactionInfo(WsatProxy wsatProxy,
CoordinationContext context,
RequestSecurityTokenResponse issuedToken)
{
this.wsatProxy = wsatProxy;
this.context = context;
this.issuedToken = issuedToken;
}
[SuppressMessage(FxCop.Category.Security, FxCop.Rule.AptcaMethodsShouldOnlyCallAptcaMethods, Justification = "The calls into CoordinationContext are safe.")]
public override Transaction UnmarshalTransaction()
{
Transaction tx;
if (WsatIncomingTransactionCache.Find(this.context.Identifier, out tx))
return tx;
tx = this.wsatProxy.UnmarshalTransaction(this);
// Cache extended information for subsequent marshal operations
WsatExtendedInformation info = new WsatExtendedInformation(context.Identifier, context.Expires);
info.TryCache(tx);
// Cache the unmarshalled transaction for subsequent unmarshal operations
WsatIncomingTransactionCache.Cache(this.context.Identifier, tx);
return tx;
}
public CoordinationContext Context
{
get { return this.context; }
}
public RequestSecurityTokenResponse IssuedToken
{
get { return this.issuedToken; }
}
}
}