Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Discovery / Version11 / AnnouncementInnerClient11.cs / 1305376 / AnnouncementInnerClient11.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Discovery.Version11 { using System.ComponentModel; using System.Runtime; using System.ServiceModel.Description; using System.Threading; class AnnouncementInnerClient11 : ClientBase, IAnnouncementInnerClient { DiscoveryMessageSequenceGenerator discoveryMessageSequenceGenerator; BeginOperationDelegate onBeginHelloOperationDelegate; EndOperationDelegate onEndHelloOperationDelegate; SendOrPostCallback onHelloOperationCompletedDelegate; BeginOperationDelegate onBeginByeOperationDelegate; EndOperationDelegate onEndByeOperationDelegate; SendOrPostCallback onByeOperationCompletedDelegate; public AnnouncementInnerClient11(AnnouncementEndpoint announcementEndpoint) : base(announcementEndpoint) { this.discoveryMessageSequenceGenerator = new DiscoveryMessageSequenceGenerator(); } event EventHandler HelloOperationCompletedEventHandler; event EventHandler ByeOperationCompletedEventHandler; event EventHandler IAnnouncementInnerClient.HelloOperationCompleted { add { this.HelloOperationCompletedEventHandler += value; } remove { this.HelloOperationCompletedEventHandler -= value; } } event EventHandler IAnnouncementInnerClient.ByeOperationCompleted { add { this.ByeOperationCompletedEventHandler += value; } remove { this.ByeOperationCompletedEventHandler -= value; } } public DiscoveryMessageSequenceGenerator DiscoveryMessageSequenceGenerator { get { return this.discoveryMessageSequenceGenerator; } set { this.discoveryMessageSequenceGenerator = value; } } public new ChannelFactory ChannelFactory { get { return base.ChannelFactory; } } public new IClientChannel InnerChannel { get { return base.InnerChannel; } } public new ServiceEndpoint Endpoint { get { return base.Endpoint; } } public ICommunicationObject InnerCommunicationObject { get { return this as ICommunicationObject; } } public void HelloOperation(EndpointDiscoveryMetadata endpointDiscoveryMetadata) { HelloMessage11 message = HelloMessage11.Create(DiscoveryMessageSequenceGenerator.Next(), endpointDiscoveryMetadata); base.Channel.HelloOperation(message); } public void ByeOperation(EndpointDiscoveryMetadata endpointDiscoveryMetadata) { ByeMessage11 message = ByeMessage11.Create(DiscoveryMessageSequenceGenerator.Next(), endpointDiscoveryMetadata); base.Channel.ByeOperation(message); } public IAsyncResult BeginHelloOperation(EndpointDiscoveryMetadata endpointDiscoveryMetadata, AsyncCallback callback, object state) { HelloMessage11 message = HelloMessage11.Create(DiscoveryMessageSequenceGenerator.Next(), endpointDiscoveryMetadata); return base.Channel.BeginHelloOperation(message, callback, state); } public void EndHelloOperation(IAsyncResult result) { base.Channel.EndHelloOperation(result); } public IAsyncResult BeginByeOperation(EndpointDiscoveryMetadata endpointDiscoveryMetadata, AsyncCallback callback, object state) { ByeMessage11 message = ByeMessage11.Create(DiscoveryMessageSequenceGenerator.Next(), endpointDiscoveryMetadata); return base.Channel.BeginByeOperation(message, callback, state); } public void EndByeOperation(IAsyncResult result) { base.Channel.EndByeOperation(result); } public void HelloOperationAsync(EndpointDiscoveryMetadata endpointDiscoveryMetadata, object userState) { HelloMessage11 message = HelloMessage11.Create(DiscoveryMessageSequenceGenerator.Next(), endpointDiscoveryMetadata); if ((this.onBeginHelloOperationDelegate == null)) { this.onBeginHelloOperationDelegate = new BeginOperationDelegate(this.OnBeginHelloOperation); } if ((this.onEndHelloOperationDelegate == null)) { this.onEndHelloOperationDelegate = new EndOperationDelegate(this.OnEndHelloOperation); } if ((this.onHelloOperationCompletedDelegate == null)) { this.onHelloOperationCompletedDelegate = Fx.ThunkCallback(new SendOrPostCallback(this.OnHelloOperationCompleted)); } base.InvokeAsync( this.onBeginHelloOperationDelegate, new object[] { message }, this.onEndHelloOperationDelegate, this.onHelloOperationCompletedDelegate, userState); } public void ByeOperationAsync(EndpointDiscoveryMetadata endpointDiscoveryMetadata, object userState) { ByeMessage11 message = ByeMessage11.Create(DiscoveryMessageSequenceGenerator.Next(), endpointDiscoveryMetadata); if (this.onBeginByeOperationDelegate == null) { this.onBeginByeOperationDelegate = new BeginOperationDelegate(this.OnBeginByeOperation); } if ((this.onEndByeOperationDelegate == null)) { this.onEndByeOperationDelegate = new EndOperationDelegate(this.OnEndByeOperation); } if ((this.onByeOperationCompletedDelegate == null)) { this.onByeOperationCompletedDelegate = Fx.ThunkCallback(new SendOrPostCallback(this.OnByeOperationCompleted)); } base.InvokeAsync( this.onBeginByeOperationDelegate, new object[] { message }, this.onEndByeOperationDelegate, this.onByeOperationCompletedDelegate, userState); } IAsyncResult BeginHelloOperation(HelloMessage11 message, AsyncCallback callback, object state) { return base.Channel.BeginHelloOperation(message, callback, state); } IAsyncResult BeginByeOperation(ByeMessage11 message, AsyncCallback callback, object state) { return base.Channel.BeginByeOperation(message, callback, state); } IAsyncResult OnBeginHelloOperation(object[] inValues, System.AsyncCallback callback, object asyncState) { HelloMessage11 message = ((HelloMessage11)(inValues[0])); return this.BeginHelloOperation(message, callback, asyncState); } object[] OnEndHelloOperation(System.IAsyncResult result) { this.EndHelloOperation(result); return null; } void OnHelloOperationCompleted(object state) { if ((this.HelloOperationCompletedEventHandler != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); this.HelloOperationCompletedEventHandler(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState)); } } IAsyncResult OnBeginByeOperation(object[] inValues, System.AsyncCallback callback, object asyncState) { ByeMessage11 message = ((ByeMessage11)(inValues[0])); return this.BeginByeOperation(message, callback, asyncState); } object[] OnEndByeOperation(System.IAsyncResult result) { this.EndByeOperation(result); return null; } void OnByeOperationCompleted(object state) { if (this.ByeOperationCompletedEventHandler != null) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); this.ByeOperationCompletedEventHandler(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState)); } } } } // 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
- SystemDropShadowChrome.cs
- RelationHandler.cs
- ColumnReorderedEventArgs.cs
- ServicePointManager.cs
- ToolStripDropDownDesigner.cs
- DataSourceExpression.cs
- Publisher.cs
- InternalDispatchObject.cs
- XPathCompileException.cs
- Thread.cs
- XmlComment.cs
- RMEnrollmentPage3.cs
- LayoutEvent.cs
- TrackPoint.cs
- PenThreadPool.cs
- Columns.cs
- TextServicesCompartmentEventSink.cs
- EntityDescriptor.cs
- DbConvert.cs
- StorageEntityTypeMapping.cs
- PropertyInfoSet.cs
- ActiveXSite.cs
- PageSettings.cs
- AddInActivator.cs
- ProfileSection.cs
- DataDocumentXPathNavigator.cs
- AdapterUtil.cs
- ActivityFunc.cs
- BinaryNode.cs
- MessageQueueKey.cs
- HandlerWithFactory.cs
- XmlSchemaAnnotated.cs
- Route.cs
- ViewStateModeByIdAttribute.cs
- OdbcErrorCollection.cs
- CachingHintValidation.cs
- KeyValueConfigurationElement.cs
- KeyGestureValueSerializer.cs
- LoadedOrUnloadedOperation.cs
- EditorAttribute.cs
- RelationshipEndCollection.cs
- ButtonRenderer.cs
- XsltArgumentList.cs
- Stopwatch.cs
- StatusCommandUI.cs
- DisableDpiAwarenessAttribute.cs
- FullTextLine.cs
- EmptyQuery.cs
- FactoryRecord.cs
- ServicePoint.cs
- WebControlAdapter.cs
- RefreshEventArgs.cs
- EdmSchemaAttribute.cs
- SerializationInfoEnumerator.cs
- EntityContainer.cs
- StaticTextPointer.cs
- OverlappedContext.cs
- InputElement.cs
- IntSumAggregationOperator.cs
- ListViewItemEventArgs.cs
- CursorConverter.cs
- DocumentOrderQuery.cs
- ToolStripPanelRow.cs
- util.cs
- RecordsAffectedEventArgs.cs
- UInt16Storage.cs
- DecimalKeyFrameCollection.cs
- PersianCalendar.cs
- ListViewInsertedEventArgs.cs
- CompiledQueryCacheKey.cs
- CacheOutputQuery.cs
- SemanticResolver.cs
- DateTimeOffset.cs
- DataControlImageButton.cs
- METAHEADER.cs
- XmlArrayItemAttribute.cs
- ConditionedDesigner.cs
- WebPartConnectionCollection.cs
- ObjectResult.cs
- ADMembershipProvider.cs
- CaretElement.cs
- DoubleIndependentAnimationStorage.cs
- UICuesEvent.cs
- StylusButtonEventArgs.cs
- UnsafeCollabNativeMethods.cs
- SamlAuthorizationDecisionStatement.cs
- AsymmetricKeyExchangeDeformatter.cs
- InstanceLockTracking.cs
- Attributes.cs
- ActivationProxy.cs
- ContainerParaClient.cs
- PointCollectionConverter.cs
- XmlUtil.cs
- LedgerEntry.cs
- CriticalExceptions.cs
- RsaElement.cs
- XamlSerializerUtil.cs
- RemoteHelper.cs
- KeyValuePair.cs
- GreaterThanOrEqual.cs