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
- DesignerSerializationOptionsAttribute.cs
- ContextDataSourceContextData.cs
- NestPullup.cs
- MultipartContentParser.cs
- DependencyPropertyKey.cs
- HttpFileCollectionWrapper.cs
- XhtmlBasicListAdapter.cs
- EntityViewGenerator.cs
- AncestorChangedEventArgs.cs
- NativeMethods.cs
- securestring.cs
- DmlSqlGenerator.cs
- InvalidPropValue.cs
- SingleConverter.cs
- VBCodeProvider.cs
- UnsignedPublishLicense.cs
- Path.cs
- EventLogPermission.cs
- XsdBuildProvider.cs
- CollectionViewGroupInternal.cs
- SoapSchemaImporter.cs
- ProfileSettingsCollection.cs
- CollectionViewProxy.cs
- LinqDataSource.cs
- EmissiveMaterial.cs
- SendActivityDesignerTheme.cs
- RootBrowserWindowProxy.cs
- OdbcTransaction.cs
- XmlNamespaceDeclarationsAttribute.cs
- CodeStatementCollection.cs
- CodeVariableReferenceExpression.cs
- Hyperlink.cs
- DbProviderManifest.cs
- ObjectSecurity.cs
- Context.cs
- ObjectDataSourceMethodEventArgs.cs
- GreenMethods.cs
- CompilerTypeWithParams.cs
- SafeThreadHandle.cs
- COM2Enum.cs
- ItemAutomationPeer.cs
- MembershipUser.cs
- FixedNode.cs
- SplayTreeNode.cs
- Helpers.cs
- DataGridViewTextBoxColumn.cs
- IArgumentProvider.cs
- ImportFileRequest.cs
- UserValidatedEventArgs.cs
- CanonicalFontFamilyReference.cs
- PageRouteHandler.cs
- WebPartConnectionsEventArgs.cs
- TypeUsage.cs
- CompressedStack.cs
- AssertUtility.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- Misc.cs
- Delegate.cs
- ToolStripTextBox.cs
- SourceFileBuildProvider.cs
- LinearGradientBrush.cs
- PrinterResolution.cs
- ValidationError.cs
- ConstraintEnumerator.cs
- ExpressionQuoter.cs
- TableItemStyle.cs
- SuppressIldasmAttribute.cs
- WrapPanel.cs
- LongSumAggregationOperator.cs
- RemoteWebConfigurationHostServer.cs
- AbandonedMutexException.cs
- BrowserTree.cs
- ToolboxItemFilterAttribute.cs
- TemplateAction.cs
- Panel.cs
- ProcessProtocolHandler.cs
- PersonalizationEntry.cs
- diagnosticsswitches.cs
- RuntimeHelpers.cs
- DoubleLinkListEnumerator.cs
- DocComment.cs
- GeometryHitTestResult.cs
- RoleServiceManager.cs
- AdRotator.cs
- TripleDESCryptoServiceProvider.cs
- PropertyTabAttribute.cs
- ControlValuePropertyAttribute.cs
- ContainerSelectorBehavior.cs
- MediaTimeline.cs
- PropertyGridEditorPart.cs
- WrappedKeySecurityTokenParameters.cs
- Pair.cs
- ClosableStream.cs
- HttpStaticObjectsCollectionBase.cs
- CodeGroup.cs
- MediaElement.cs
- TextTreeRootTextBlock.cs
- WebPartManagerDesigner.cs
- ObjectDataSourceDesigner.cs
- ExpressionLink.cs