Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / TransactionBridge / Microsoft / Transactions / Wsat / Messaging / AsyncCallback.cs / 1 / AsyncCallback.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
// Define asynchronous callback classes used when sending async messages
using System;
using System.ServiceModel.Channels;
using System.Diagnostics;
using System.ServiceModel;
using System.Transactions;
using System.Xml;
namespace Microsoft.Transactions.Wsat.Messaging
{
// This class represents the completion of a request/reply message dispatched by ServiceModel
class RequestAsyncResult : AsyncResult
{
Message reply;
MessageVersion messageVersion;
UniqueId messageID;
public RequestAsyncResult (Message message, AsyncCallback callback, object state) : base (callback, state)
{
this.messageVersion = message.Version;
this.messageID = message.Headers.MessageId;
}
public MessageVersion MessageVersion
{
get { return this.messageVersion; }
}
public UniqueId MessageId
{
get { return this.messageID; }
}
public Message Reply
{
get { return this.reply; }
}
public void Finished (Message reply)
{
this.reply = reply;
this.Complete (false);
}
public void Finished (Exception exception)
{
this.Complete (false, exception);
}
public void End()
{
AsyncResult.End(this);
}
}
// This class exists to provide the illusion that a BeginSend operation only throws on End
class SendMessageFailureAsyncResult : AsyncResult
{
public SendMessageFailureAsyncResult (Exception e, AsyncCallback callback, object state) : base (callback, state)
{
base.Complete (true, e);
}
public void End()
{
AsyncResult.End(this);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EncoderParameters.cs
- HttpModuleAction.cs
- WebEvents.cs
- ServicePoint.cs
- HttpGetProtocolReflector.cs
- PriorityQueue.cs
- ServiceOperation.cs
- Vector3dCollection.cs
- Events.cs
- LinkedDataMemberFieldEditor.cs
- StrokeNodeOperations2.cs
- SynchronizationLockException.cs
- ProtectedProviderSettings.cs
- MetadataItem_Static.cs
- FileSystemInfo.cs
- connectionpool.cs
- TextElement.cs
- DocumentOrderQuery.cs
- PartBasedPackageProperties.cs
- SmtpMail.cs
- SqlNodeAnnotations.cs
- _CookieModule.cs
- OracleDataReader.cs
- Vector3D.cs
- SnapshotChangeTrackingStrategy.cs
- ValidationSummary.cs
- XmlTextReader.cs
- PreservationFileReader.cs
- ObjectHelper.cs
- DoubleLinkList.cs
- SqlServer2KCompatibilityAnnotation.cs
- DataGridCellAutomationPeer.cs
- RootBrowserWindowAutomationPeer.cs
- ConfigXmlText.cs
- OuterGlowBitmapEffect.cs
- UnmanagedMemoryStreamWrapper.cs
- TypeBuilderInstantiation.cs
- XmlCharacterData.cs
- RegexCaptureCollection.cs
- XmlConvert.cs
- X509Utils.cs
- EntityException.cs
- CurrencyWrapper.cs
- TreeViewHitTestInfo.cs
- ItemChangedEventArgs.cs
- StyleModeStack.cs
- StatusBarDrawItemEvent.cs
- UnaryNode.cs
- TemplatedMailWebEventProvider.cs
- RSAPKCS1KeyExchangeFormatter.cs
- DataGridViewCheckBoxCell.cs
- InstanceData.cs
- GeometryConverter.cs
- FixedTextContainer.cs
- PolicyUnit.cs
- Rotation3DAnimation.cs
- TableChangeProcessor.cs
- PartialArray.cs
- XmlReaderSettings.cs
- SuppressMessageAttribute.cs
- XmlCompatibilityReader.cs
- InputManager.cs
- ConstNode.cs
- ToolStripStatusLabel.cs
- BrushValueSerializer.cs
- EdmToObjectNamespaceMap.cs
- ConfigurationElement.cs
- ModelTreeEnumerator.cs
- Misc.cs
- PersistChildrenAttribute.cs
- BaseProcessProtocolHandler.cs
- MultilineStringConverter.cs
- X509DefaultServiceCertificateElement.cs
- DocumentPageTextView.cs
- InteropBitmapSource.cs
- ListBase.cs
- securitycriticaldata.cs
- CommandID.cs
- MatrixCamera.cs
- OpenFileDialog.cs
- EventMappingSettings.cs
- PreservationFileWriter.cs
- FlowDocumentScrollViewer.cs
- RequestUriProcessor.cs
- SwitchLevelAttribute.cs
- ValueConversionAttribute.cs
- ShapingEngine.cs
- ObjectDataSourceStatusEventArgs.cs
- ThreadAttributes.cs
- FormParameter.cs
- _KerberosClient.cs
- ThreadStateException.cs
- ObjectListItemCollection.cs
- FontInfo.cs
- EventLogConfiguration.cs
- ManagementDateTime.cs
- FolderNameEditor.cs
- WindowsRegion.cs
- SqlInternalConnection.cs
- Number.cs