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
- ResourceReader.cs
- NamedPipeConnectionPool.cs
- OutputCacheProfileCollection.cs
- SystemPens.cs
- StrongNameIdentityPermission.cs
- XmlNodeReader.cs
- XmlWrappingWriter.cs
- FileSystemInfo.cs
- Accessible.cs
- SecurityElement.cs
- PageAdapter.cs
- EventLogPermissionAttribute.cs
- SynchronizedReadOnlyCollection.cs
- DispatcherHookEventArgs.cs
- PageTheme.cs
- NetCodeGroup.cs
- BooleanAnimationBase.cs
- WebPartTransformerCollection.cs
- UIAgentAsyncBeginRequest.cs
- MultiSelectRootGridEntry.cs
- TextReader.cs
- SafeWaitHandle.cs
- System.Data_BID.cs
- Decimal.cs
- CheckPair.cs
- Visual3D.cs
- QuadraticBezierSegment.cs
- MenuItemBindingCollection.cs
- DefaultBinder.cs
- FormViewInsertEventArgs.cs
- DocumentPageView.cs
- ObjectSecurityT.cs
- ToolStripComboBox.cs
- ExecutedRoutedEventArgs.cs
- XmlSchemaException.cs
- TextOnlyOutput.cs
- FullTextLine.cs
- HttpSocketManager.cs
- StorageEntityContainerMapping.cs
- Int16.cs
- Material.cs
- DataPagerFieldItem.cs
- WindowsPen.cs
- EncoderReplacementFallback.cs
- UnsafeNativeMethodsCLR.cs
- GridViewSelectEventArgs.cs
- WebPartCatalogCloseVerb.cs
- InvokeCompletedEventArgs.cs
- Signature.cs
- LoginCancelEventArgs.cs
- FrameworkContentElement.cs
- HttpCacheParams.cs
- Rect3D.cs
- CodeObjectCreateExpression.cs
- HttpRuntime.cs
- PersonalizationProviderHelper.cs
- PlatformCulture.cs
- HMACMD5.cs
- DataTableReaderListener.cs
- LogEntry.cs
- XPathSelectionIterator.cs
- XPathDescendantIterator.cs
- XmlProcessingInstruction.cs
- userdatakeys.cs
- wgx_commands.cs
- StructureChangedEventArgs.cs
- HtmlTitle.cs
- FrameworkReadOnlyPropertyMetadata.cs
- HttpRequest.cs
- ObjectFullSpanRewriter.cs
- Logging.cs
- DbConnectionFactory.cs
- ImageInfo.cs
- DefaultPropertyAttribute.cs
- ThreadLocal.cs
- QueryAccessibilityHelpEvent.cs
- HttpHandlerAction.cs
- EntityDataSourceState.cs
- StyleBamlRecordReader.cs
- TableCellCollection.cs
- OperationDescriptionCollection.cs
- GridViewUpdateEventArgs.cs
- PartialList.cs
- AsyncResult.cs
- MILUtilities.cs
- HashCryptoHandle.cs
- VersionPair.cs
- Resources.Designer.cs
- DynamicQueryableWrapper.cs
- HttpBufferlessInputStream.cs
- XmlSchemaAny.cs
- SmiMetaDataProperty.cs
- PerformanceCountersElement.cs
- ParamArrayAttribute.cs
- PageTheme.cs
- BaseParagraph.cs
- SvcMapFileLoader.cs
- TextWriter.cs
- SelectedCellsCollection.cs
- Page.cs