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
- ViewStateAttachedPropertyFeature.cs
- httpapplicationstate.cs
- SessionEndingEventArgs.cs
- CircleHotSpot.cs
- QilList.cs
- SelectionListComponentEditor.cs
- EntityViewGenerationConstants.cs
- UIAgentRequest.cs
- CatalogPart.cs
- MsmqInputSessionChannel.cs
- AutoResetEvent.cs
- EventProxy.cs
- UIElementParaClient.cs
- DataTransferEventArgs.cs
- SeparatorAutomationPeer.cs
- ResizeBehavior.cs
- Group.cs
- SynchronizedPool.cs
- MachineKeySection.cs
- XPathNodeIterator.cs
- ArgIterator.cs
- PackageStore.cs
- XmlSchemaAttribute.cs
- DodSequenceMerge.cs
- validationstate.cs
- mediaclock.cs
- BypassElement.cs
- WebHttpSecurityModeHelper.cs
- Instrumentation.cs
- VerificationException.cs
- FrameworkPropertyMetadata.cs
- DependencyPropertyKind.cs
- XmlUtilWriter.cs
- DoubleLinkListEnumerator.cs
- ViewManager.cs
- AnnotationResourceChangedEventArgs.cs
- DeploymentSectionCache.cs
- ExtensionQuery.cs
- controlskin.cs
- AsyncOperation.cs
- ValueCollectionParameterReader.cs
- TypedTableBase.cs
- DataSourceXmlTextReader.cs
- QueryOutputWriterV1.cs
- WorkItem.cs
- MaterialCollection.cs
- ReflectionPermission.cs
- XmlStreamStore.cs
- InfoCardTraceRecord.cs
- ToolStripProgressBar.cs
- PeerCustomResolverElement.cs
- DataControlPagerLinkButton.cs
- CodeChecksumPragma.cs
- BaseParser.cs
- ChangePasswordDesigner.cs
- VerificationException.cs
- ExpressionNormalizer.cs
- ExtendedProtectionPolicyElement.cs
- NavigationFailedEventArgs.cs
- userdatakeys.cs
- HMACRIPEMD160.cs
- NavigationService.cs
- _LocalDataStore.cs
- GroupDescription.cs
- DetailsViewInsertedEventArgs.cs
- Visitors.cs
- ObjectView.cs
- ButtonAutomationPeer.cs
- ReadOnlyHierarchicalDataSourceView.cs
- TextSegment.cs
- GestureRecognitionResult.cs
- Int16KeyFrameCollection.cs
- WorkflowServiceNamespace.cs
- MultiView.cs
- Nodes.cs
- BrushValueSerializer.cs
- Delegate.cs
- Screen.cs
- DmlSqlGenerator.cs
- MenuCommand.cs
- ManifestBasedResourceGroveler.cs
- DirectoryLocalQuery.cs
- followingsibling.cs
- FileUpload.cs
- SerializerDescriptor.cs
- ActivationArguments.cs
- translator.cs
- SqlMethodTransformer.cs
- OleDbError.cs
- DeferredElementTreeState.cs
- TextBoxView.cs
- OdbcDataAdapter.cs
- XmlHierarchicalEnumerable.cs
- PublisherIdentityPermission.cs
- TrustExchangeException.cs
- DetailsViewPageEventArgs.cs
- SqlWebEventProvider.cs
- XPathQilFactory.cs
- IODescriptionAttribute.cs
- WaitForChangedResult.cs