Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Activities / System / ServiceModel / Activities / Description / ControlOperationBehavior.cs / 1305376 / ControlOperationBehavior.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Activities.Description { using System.Runtime; using System.ServiceModel.Activities.Dispatcher; using System.ServiceModel.Channels; using System.ServiceModel.Description; using System.ServiceModel.Dispatcher; class ControlOperationBehavior : IOperationBehavior { bool isWrappedMode; //There are two modes of operation. // 1) IWorkflowControlServiceOperations :: Implemented completley by the ControlOperationInvoker. // 2) Infrastructure endpoints(Delay/Compensation/OCS) where we wrap their invoker over ControlOperationInvoker. public ControlOperationBehavior(bool isWrappedMode) { this.isWrappedMode = isWrappedMode; } public void AddBindingParameters(OperationDescription operationDescription, BindingParameterCollection bindingParameters) { } public void ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation) { } public void ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation) { ServiceHostBase serviceHost = dispatchOperation.Parent.ChannelDispatcher.Host; if (!(serviceHost is WorkflowServiceHost)) { throw FxTrace.Exception.AsError( new InvalidOperationException(SR.WorkflowBehaviorWithNonWorkflowHost(typeof(ControlOperationBehavior).Name))); } ServiceEndpoint endpoint = null; foreach (ServiceEndpoint endpointToMatch in serviceHost.Description.Endpoints) { if (endpointToMatch.Id == dispatchOperation.Parent.EndpointDispatcher.Id) { endpoint = endpointToMatch; break; } } if (this.isWrappedMode) { CorrelationKeyCalculator keyCalculator = null; if (endpoint != null) { CorrelationQueryBehavior endpointQueryBehavior = endpoint.Behaviors.Find(); if (endpointQueryBehavior != null) { keyCalculator = endpointQueryBehavior.GetKeyCalculator(); } } //This will be the case for infrastructure endpoints like Compensation/Interop OCS endpoints. dispatchOperation.Invoker = new ControlOperationInvoker( operationDescription, endpoint, keyCalculator, dispatchOperation.Invoker, serviceHost); } else { //This will be for IWorkflowInstanceManagement endpoint operation. dispatchOperation.Invoker = new ControlOperationInvoker( operationDescription, endpoint, null, serviceHost); } } public void Validate(OperationDescription operationDescription) { } } } // 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
- FixedSOMImage.cs
- DCSafeHandle.cs
- SendActivityEventArgs.cs
- HostedTcpTransportManager.cs
- CellTreeNode.cs
- ServicePoint.cs
- CrossContextChannel.cs
- ReadWriteSpinLock.cs
- Rect3D.cs
- SQLSingleStorage.cs
- InputScopeAttribute.cs
- PrincipalPermissionMode.cs
- ServiceControllerDesigner.cs
- WindowsAltTab.cs
- Light.cs
- Number.cs
- AutomationProperties.cs
- AvTraceFormat.cs
- ToolStripTemplateNode.cs
- CreatingCookieEventArgs.cs
- PingReply.cs
- HtmlMeta.cs
- Rotation3DAnimationBase.cs
- DocumentPageTextView.cs
- RealProxy.cs
- TabRenderer.cs
- RsaSecurityKey.cs
- EUCJPEncoding.cs
- FormsAuthenticationModule.cs
- DataGridColumnCollection.cs
- InstalledVoice.cs
- TrackingCondition.cs
- ProfileSettings.cs
- SoapAttributes.cs
- UserControlCodeDomTreeGenerator.cs
- ElementInit.cs
- RelationshipEndCollection.cs
- ProfilePropertySettings.cs
- Win32SafeHandles.cs
- ErrorLog.cs
- ToolbarAUtomationPeer.cs
- Pen.cs
- OneWayChannelFactory.cs
- IndexedString.cs
- TextureBrush.cs
- MsmqElementBase.cs
- ClientProtocol.cs
- StylusLogic.cs
- UnorderedHashRepartitionStream.cs
- ListViewItem.cs
- DocumentViewerBaseAutomationPeer.cs
- OdbcRowUpdatingEvent.cs
- TextProperties.cs
- ExceptionUtil.cs
- OutputCacheProviderCollection.cs
- BasicExpressionVisitor.cs
- UpdateProgress.cs
- DataGridViewCellValidatingEventArgs.cs
- PolyLineSegment.cs
- _DomainName.cs
- PageContent.cs
- ObjectDataSourceFilteringEventArgs.cs
- ObjectViewEntityCollectionData.cs
- CustomActivityDesigner.cs
- WebPartConnectionsEventArgs.cs
- SqlHelper.cs
- QueryResponse.cs
- NodeCounter.cs
- SqlFactory.cs
- Context.cs
- OutputCacheSection.cs
- BitStream.cs
- OracleConnectionStringBuilder.cs
- initElementDictionary.cs
- DefaultPropertyAttribute.cs
- WindowInteractionStateTracker.cs
- Calendar.cs
- ScaleTransform3D.cs
- TextRunTypographyProperties.cs
- MultiSelector.cs
- XmlMtomReader.cs
- NestPullup.cs
- DbProviderServices.cs
- AccessedThroughPropertyAttribute.cs
- ExcCanonicalXml.cs
- FrameworkObject.cs
- UserPreferenceChangingEventArgs.cs
- BindingValueChangedEventArgs.cs
- AnonymousIdentificationModule.cs
- CustomError.cs
- MemberAccessException.cs
- DataGridColumn.cs
- TextContainerHelper.cs
- UnsafeNativeMethods.cs
- ProtocolsConfiguration.cs
- List.cs
- coordinator.cs
- _ListenerAsyncResult.cs
- BitmapSizeOptions.cs
- ProxyWebPart.cs