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
- DurationConverter.cs
- Base64WriteStateInfo.cs
- BitStack.cs
- DataSet.cs
- PointConverter.cs
- ServiceModelConfigurationElementCollection.cs
- ControlValuePropertyAttribute.cs
- MatcherBuilder.cs
- DefaultObjectSerializer.cs
- OleDbMetaDataFactory.cs
- MemoryStream.cs
- XslCompiledTransform.cs
- OdbcConnectionStringbuilder.cs
- StringUtil.cs
- DataControlPagerLinkButton.cs
- CommandLibraryHelper.cs
- RtfControlWordInfo.cs
- PersistenceTypeAttribute.cs
- SafeProcessHandle.cs
- CatalogZoneBase.cs
- SafeHandles.cs
- ViewgenContext.cs
- ConnectionsZoneAutoFormat.cs
- XmlObjectSerializerReadContextComplexJson.cs
- CommentEmitter.cs
- FlowPanelDesigner.cs
- ZoneMembershipCondition.cs
- PeerApplicationLaunchInfo.cs
- PointCollection.cs
- ErrorFormatterPage.cs
- SqlWriter.cs
- WebPartUtil.cs
- Size.cs
- CodeCatchClauseCollection.cs
- OdbcStatementHandle.cs
- NodeFunctions.cs
- DataControlLinkButton.cs
- PartialList.cs
- LocationSectionRecord.cs
- PathTooLongException.cs
- DataGridViewCellParsingEventArgs.cs
- WinInet.cs
- WebPartActionVerb.cs
- coordinatorfactory.cs
- CompilerError.cs
- AsyncCodeActivityContext.cs
- DataKeyArray.cs
- LayoutInformation.cs
- HandlerBase.cs
- control.ime.cs
- StaticFileHandler.cs
- GlyphCollection.cs
- Queue.cs
- WindowsSolidBrush.cs
- ReadOnlyCollection.cs
- ProvidePropertyAttribute.cs
- IfJoinedCondition.cs
- WindowsFormsHostAutomationPeer.cs
- X509UI.cs
- XmlAttributeOverrides.cs
- HttpBrowserCapabilitiesWrapper.cs
- WebBrowserUriTypeConverter.cs
- DoubleAnimationUsingKeyFrames.cs
- SourceInterpreter.cs
- ContextMenuAutomationPeer.cs
- DeviceFilterDictionary.cs
- SqlDependency.cs
- CachedRequestParams.cs
- HierarchicalDataSourceControl.cs
- Command.cs
- SimpleApplicationHost.cs
- StylusCollection.cs
- InvokeProviderWrapper.cs
- DataGridViewLinkColumn.cs
- TextServicesCompartmentEventSink.cs
- CTreeGenerator.cs
- MetadataCache.cs
- EncodingNLS.cs
- UserUseLicenseDictionaryLoader.cs
- LinkUtilities.cs
- BindingMemberInfo.cs
- NavigationProperty.cs
- AssemblyAssociatedContentFileAttribute.cs
- SHA1.cs
- ChangesetResponse.cs
- XmlBinaryReader.cs
- LocalizationParserHooks.cs
- Int16.cs
- ObjectResult.cs
- RtfToXamlReader.cs
- NumericExpr.cs
- CachedFontFace.cs
- Int16Converter.cs
- TextBoxAutoCompleteSourceConverter.cs
- ListViewGroup.cs
- LeaseManager.cs
- ColumnPropertiesGroup.cs
- MachineSettingsSection.cs
- XmlSchemaRedefine.cs
- control.ime.cs