Files
dotnet-bot adf899c629 Adding System.Data..., System.ServiceModel..., and System.Web...
Adding reference source for
System.Data
System.Data.DataSetExtensions
System.Data.Entity
System.Data.Entity.Design
System.Data.Linq
System.Data.SqlXml
System.ServiceModel
System.ServiceModel.Activation
System.ServiceModel.Activities
System.ServiceModel.Channels
System.ServiceModel.Discovery
System.ServiceModel.Internals
System.ServiceModel.Routing
System.ServiceModel.WasHosting
System.ServiceModel.Web
System.Web
System.Web.ApplicationServices
System.Web.DynamicData
System.Web.Entity
System.Web.Entity.Design
System.Web.Extensions
System.Web.Mobile
System.Web.Routing
System.Web.Services
System.Xml
System.Xml.Linq
2016-05-03 00:07:37 +02:00

61 lines
2.0 KiB
C#

//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace System.ServiceModel.Transactions
{
using System.Transactions;
class WsatExtendedInformation
{
string identifier;
uint timeout;
public WsatExtendedInformation(string identifier, uint timeout)
{
this.identifier = identifier;
this.timeout = timeout;
}
public string Identifier
{
get { return this.identifier; }
}
public uint Timeout
{
get { return this.timeout; }
}
public void TryCache(Transaction tx)
{
Guid transactionId = tx.TransactionInformation.DistributedIdentifier;
bool nativeId = IsNativeIdentifier(this.identifier, transactionId);
string cacheIdentifier = nativeId ? null : this.identifier;
if (!string.IsNullOrEmpty(cacheIdentifier) || this.timeout != 0)
{
// Cache extended information for subsequent marshal operations
WsatExtendedInformationCache.Cache(tx, new WsatExtendedInformation(cacheIdentifier,
this.timeout));
}
}
// Copied Helper method from CoordinationContext so we don't have to have this type
public const string UuidScheme = "urn:uuid:";
public static string CreateNativeIdentifier(Guid transactionId)
{
return UuidScheme + transactionId.ToString("D");
}
public static bool IsNativeIdentifier(string identifier, Guid transactionId)
{
return string.Compare(identifier,
CreateNativeIdentifier(transactionId),
StringComparison.Ordinal) == 0;
}
}
}