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
- DATA_BLOB.cs
- EndEvent.cs
- CharAnimationBase.cs
- DBSchemaRow.cs
- GraphicsContext.cs
- PathSegmentCollection.cs
- UIElementParaClient.cs
- TaskResultSetter.cs
- BindingSource.cs
- CodeMethodMap.cs
- IIS7UserPrincipal.cs
- CheckBoxStandardAdapter.cs
- TextureBrush.cs
- DataGridViewTextBoxCell.cs
- PropertyTabAttribute.cs
- ProxyWebPartManager.cs
- WebBrowserNavigatingEventHandler.cs
- JapaneseLunisolarCalendar.cs
- MD5CryptoServiceProvider.cs
- RegexInterpreter.cs
- Application.cs
- ThreadStaticAttribute.cs
- SafeHandles.cs
- AssemblySettingAttributes.cs
- SpeechUI.cs
- _NativeSSPI.cs
- OleDbRowUpdatedEvent.cs
- DefaultDialogButtons.cs
- SymbolType.cs
- GroupItemAutomationPeer.cs
- CodeAttachEventStatement.cs
- WsatServiceCertificate.cs
- WpfXamlType.cs
- MetafileHeaderWmf.cs
- BypassElement.cs
- StandardOleMarshalObject.cs
- MgmtConfigurationRecord.cs
- CodeAttachEventStatement.cs
- AssociationTypeEmitter.cs
- followingquery.cs
- BuildProviderCollection.cs
- MultipartIdentifier.cs
- DispatcherObject.cs
- OracleConnectionStringBuilder.cs
- OleAutBinder.cs
- VectorCollectionConverter.cs
- PrintControllerWithStatusDialog.cs
- BamlStream.cs
- SiteMapDataSource.cs
- FormatSelectingMessageInspector.cs
- baseshape.cs
- PieceNameHelper.cs
- Assign.cs
- BuildResultCache.cs
- TabControl.cs
- NavigateEvent.cs
- MultiDataTrigger.cs
- HtmlShim.cs
- HashJoinQueryOperatorEnumerator.cs
- XsltException.cs
- MemberAssignment.cs
- Calendar.cs
- GridViewColumnHeader.cs
- DiscreteKeyFrames.cs
- DataSourceView.cs
- Decoder.cs
- XamlWriter.cs
- StaticFileHandler.cs
- GenericParameterDataContract.cs
- XmlStreamStore.cs
- CompositeTypefaceMetrics.cs
- InvokeCompletedEventArgs.cs
- SoapDocumentServiceAttribute.cs
- PropertyEmitter.cs
- MemberPath.cs
- FontFamilyValueSerializer.cs
- EventQueueState.cs
- WebPartCatalogAddVerb.cs
- DiscoveryProxy.cs
- WebPartEditorOkVerb.cs
- WizardSideBarListControlItemEventArgs.cs
- DefaultPropertyAttribute.cs
- FileNotFoundException.cs
- NativeMethodsCLR.cs
- SafeFileHandle.cs
- LocatorBase.cs
- MonthChangedEventArgs.cs
- Menu.cs
- SafeHandle.cs
- UIElement3D.cs
- HashMembershipCondition.cs
- ObjectListFieldsPage.cs
- TextInfo.cs
- SizeAnimationBase.cs
- PrimitiveXmlSerializers.cs
- Nodes.cs
- WorkflowServiceNamespace.cs
- ResXBuildProvider.cs
- PropertyGridCommands.cs
- BooleanAnimationUsingKeyFrames.cs