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
- DateBoldEvent.cs
- CollectionChangeEventArgs.cs
- ScrollPattern.cs
- SecureEnvironment.cs
- UnsafeNativeMethods.cs
- ProfileServiceManager.cs
- SafeNativeMethodsOther.cs
- ConfigUtil.cs
- dsa.cs
- HwndHost.cs
- SerializationSectionGroup.cs
- OperandQuery.cs
- SQLInt64Storage.cs
- DataMemberConverter.cs
- BinaryReader.cs
- DecoderBestFitFallback.cs
- InternalCache.cs
- RegexRunner.cs
- ResXResourceSet.cs
- XPathPatternBuilder.cs
- InvalidMessageContractException.cs
- DataBoundLiteralControl.cs
- DesignerMetadata.cs
- TimeSpanFormat.cs
- HtmlTableCell.cs
- AttachedPropertyMethodSelector.cs
- ResourceReader.cs
- CryptoApi.cs
- ObjectListCommand.cs
- Rule.cs
- StylusPointCollection.cs
- AttributeQuery.cs
- QueryCacheKey.cs
- ScriptHandlerFactory.cs
- DataGridViewHeaderCell.cs
- CryptoHandle.cs
- UrlMappingCollection.cs
- TimelineClockCollection.cs
- SystemThemeKey.cs
- PropertyInfoSet.cs
- InvalidDataException.cs
- XmlAggregates.cs
- StorageEntityTypeMapping.cs
- FunctionDetailsReader.cs
- TextTreeFixupNode.cs
- DynamicQueryableWrapper.cs
- SoapAttributeAttribute.cs
- IISUnsafeMethods.cs
- SmiMetaData.cs
- PreviewKeyDownEventArgs.cs
- ZipPackage.cs
- ControlBindingsCollection.cs
- WindowShowOrOpenTracker.cs
- RowBinding.cs
- RadioButton.cs
- XDeferredAxisSource.cs
- WorkflowItemsPresenter.cs
- RecognizeCompletedEventArgs.cs
- FixedSOMTable.cs
- UmAlQuraCalendar.cs
- AutomationElement.cs
- JournalEntryListConverter.cs
- AssociatedControlConverter.cs
- InkCollectionBehavior.cs
- BuildProvider.cs
- BulletedListDesigner.cs
- ExpressionBuilderCollection.cs
- ParamArrayAttribute.cs
- SelectionProviderWrapper.cs
- ServicePointManager.cs
- FragmentQueryKB.cs
- XmlException.cs
- XDRSchema.cs
- InheritanceContextHelper.cs
- BindingExpressionBase.cs
- ObjectDataSourceDesigner.cs
- Keywords.cs
- DispatcherHooks.cs
- XmlSignificantWhitespace.cs
- EntityViewContainer.cs
- ModelPropertyCollectionImpl.cs
- ParenthesizePropertyNameAttribute.cs
- DeviceContext2.cs
- FixedSOMTableCell.cs
- RestHandlerFactory.cs
- isolationinterop.cs
- CurrencyWrapper.cs
- EditorZoneDesigner.cs
- DispatcherProcessingDisabled.cs
- EnvironmentPermission.cs
- ServerValidateEventArgs.cs
- FormsAuthenticationCredentials.cs
- FontCacheUtil.cs
- ScriptBehaviorDescriptor.cs
- QueryInterceptorAttribute.cs
- remotingproxy.cs
- RecordConverter.cs
- ParameterSubsegment.cs
- MbpInfo.cs
- MetadataCache.cs