Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Discovery / AnnouncementSendsAsyncResult.cs / 1305376 / AnnouncementSendsAsyncResult.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Discovery { using System.Xml; using System.Runtime; using System.Collections.ObjectModel; class AnnouncementSendsAsyncResult : RandomDelaySendsAsyncResult { AnnouncementClient announcementClient; CollectionpublishedEndpoints; Collection messageIds; bool online; internal AnnouncementSendsAsyncResult( AnnouncementClient announcementClient, Collection publishedEndpoints, Collection messageIds, bool online, TimeSpan maxDelay, Random random, AsyncCallback callback, object state) : base(publishedEndpoints.Count, maxDelay, announcementClient, random, callback, state) { Fx.Assert(publishedEndpoints.Count == messageIds.Count, "There must be one message Ids for each EndpointDiscoveryMetadata."); this.announcementClient = announcementClient; this.publishedEndpoints = publishedEndpoints; this.messageIds = messageIds; this.online = online; } protected override IAsyncResult OnBeginSend(int index, TimeSpan timeout, AsyncCallback callback, object state) { using (new OperationContextScope(this.announcementClient.InnerChannel)) { OperationContext.Current.OutgoingMessageHeaders.MessageId = this.messageIds[index]; if (this.online) { return this.announcementClient.BeginAnnounceOnline(this.publishedEndpoints[index], callback, state); } else { return this.announcementClient.BeginAnnounceOffline(this.publishedEndpoints[index], callback, state); } } } protected override void OnEndSend(IAsyncResult result) { if (this.online) { this.announcementClient.EndAnnounceOnline(result); } else { this.announcementClient.EndAnnounceOffline(result); } } public static void End(IAsyncResult result) { AsyncResult.End (result); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- QilGenerator.cs
- PermissionAttributes.cs
- DataGridViewTextBoxCell.cs
- XmlSchemaObject.cs
- XmlCountingReader.cs
- XmlSchemaObjectCollection.cs
- WindowsListView.cs
- ScrollBarAutomationPeer.cs
- TagPrefixCollection.cs
- ImpersonateTokenRef.cs
- AlternationConverter.cs
- MarkupExtensionParser.cs
- SettingsAttributes.cs
- DataBoundControlHelper.cs
- ADMembershipUser.cs
- LexicalChunk.cs
- SchemaNotation.cs
- FormatConvertedBitmap.cs
- XmlTextReaderImplHelpers.cs
- ApplicationServiceHelper.cs
- ProjectionPruner.cs
- DocumentPageTextView.cs
- StringKeyFrameCollection.cs
- CalendarDataBindingHandler.cs
- GeometryModel3D.cs
- Win32SafeHandles.cs
- ApplyTemplatesAction.cs
- TemplatePropertyEntry.cs
- DiagnosticTrace.cs
- ExcludeFromCodeCoverageAttribute.cs
- EditCommandColumn.cs
- DbConnectionClosed.cs
- BatchParser.cs
- RecommendedAsConfigurableAttribute.cs
- ScriptingWebServicesSectionGroup.cs
- WindowsTokenRoleProvider.cs
- DrawingContextWalker.cs
- base64Transforms.cs
- HotSpotCollection.cs
- ListViewTableRow.cs
- IndependentAnimationStorage.cs
- ImageCodecInfo.cs
- CorePropertiesFilter.cs
- CodeIdentifier.cs
- ObjectViewEntityCollectionData.cs
- RegisteredHiddenField.cs
- Trigger.cs
- TransactionState.cs
- MemberJoinTreeNode.cs
- SharedDp.cs
- ParallelQuery.cs
- WindowsEditBoxRange.cs
- DiscardableAttribute.cs
- __Error.cs
- ClrProviderManifest.cs
- Renderer.cs
- ExpressionValueEditor.cs
- BinaryObjectInfo.cs
- BulletedList.cs
- IItemContainerGenerator.cs
- TransformerTypeCollection.cs
- ItemDragEvent.cs
- BypassElement.cs
- NonBatchDirectoryCompiler.cs
- BaseCollection.cs
- HttpWebRequestElement.cs
- TextElement.cs
- LinkArea.cs
- ReachVisualSerializer.cs
- ConnectionPoint.cs
- Pen.cs
- HttpCapabilitiesBase.cs
- DefaultConfirmation.cs
- XAMLParseException.cs
- XmlBinaryReaderSession.cs
- ListParaClient.cs
- TransactionInformation.cs
- Matrix.cs
- XmlStreamNodeWriter.cs
- IriParsingElement.cs
- SchemaNamespaceManager.cs
- TransformerInfoCollection.cs
- XmlSignatureManifest.cs
- RootBrowserWindowAutomationPeer.cs
- ImmutableCollection.cs
- X509Certificate.cs
- Stylesheet.cs
- RuntimeWrappedException.cs
- PaperSource.cs
- HyperlinkAutomationPeer.cs
- _RequestLifetimeSetter.cs
- GlobalDataBindingHandler.cs
- OdbcEnvironmentHandle.cs
- TraceHelpers.cs
- PropertyCondition.cs
- GorillaCodec.cs
- ValueOfAction.cs
- HashStream.cs
- ArrayExtension.cs
- SoundPlayerAction.cs