Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Description / CallbackTimeoutsBehavior.cs / 1 / CallbackTimeoutsBehavior.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Description { using System.ServiceModel.Channels; using System.ServiceModel; using System.ServiceModel.Dispatcher; using System.Runtime.Serialization; using System.Collections.ObjectModel; using System.Collections.Generic; internal class CallbackTimeoutsBehavior : IEndpointBehavior { TimeSpan transactionTimeout = TimeSpan.Zero; public TimeSpan TransactionTimeout { get { return this.transactionTimeout; } set { if (value < TimeSpan.Zero) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value, SR.GetString(SR.SFxTimeoutOutOfRange0))); } if (TimeoutHelper.IsTooLarge(value)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value, SR.GetString(SR.SFxTimeoutOutOfRangeTooBig))); } this.transactionTimeout = value; } } public CallbackTimeoutsBehavior() { } void IEndpointBehavior.Validate(ServiceEndpoint serviceEndpoint) { } void IEndpointBehavior.AddBindingParameters(ServiceEndpoint serviceEndpoint, BindingParameterCollection bindingParameters) { } void IEndpointBehavior.ApplyDispatchBehavior(ServiceEndpoint serviceEndpoint, EndpointDispatcher endpointDispatcher) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException( SR.GetString(SR.SFXEndpointBehaviorUsedOnWrongSide, typeof(CallbackTimeoutsBehavior).Name))); } void IEndpointBehavior.ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime behavior) { if(this.transactionTimeout != TimeSpan.Zero) { ChannelDispatcher channelDispatcher = behavior.CallbackDispatchRuntime.ChannelDispatcher; if ((channelDispatcher != null) && (channelDispatcher.TransactionTimeout == TimeSpan.Zero) || (channelDispatcher.TransactionTimeout > this.transactionTimeout)) { channelDispatcher.TransactionTimeout = this.transactionTimeout; } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ColorKeyFrameCollection.cs
- HtmlInputButton.cs
- UIPermission.cs
- StrokeNodeOperations.cs
- UnorderedHashRepartitionStream.cs
- PartitionResolver.cs
- Rect3D.cs
- CodeExpressionCollection.cs
- LicFileLicenseProvider.cs
- PlaceHolder.cs
- CachingHintValidation.cs
- PointValueSerializer.cs
- CodeTypeParameter.cs
- CommunicationObjectFaultedException.cs
- _CommandStream.cs
- ProtocolException.cs
- UnionCodeGroup.cs
- WindowsFormsHost.cs
- File.cs
- CopyOnWriteList.cs
- BamlTreeMap.cs
- RichTextBox.cs
- ETagAttribute.cs
- CorrelationService.cs
- CustomErrorCollection.cs
- ConfigurationElement.cs
- SerializationInfo.cs
- DbConnectionPoolGroup.cs
- MarkupProperty.cs
- RowVisual.cs
- ScalarType.cs
- SqlConnectionPoolProviderInfo.cs
- SqlTrackingWorkflowInstance.cs
- ListViewInsertedEventArgs.cs
- AlternateViewCollection.cs
- NetworkStream.cs
- Utils.cs
- HtmlInputPassword.cs
- CFStream.cs
- AppearanceEditorPart.cs
- SkewTransform.cs
- PropertyGridEditorPart.cs
- Size.cs
- ModifierKeysValueSerializer.cs
- UserPersonalizationStateInfo.cs
- PropertyEmitter.cs
- StylusTip.cs
- WorkflowShape.cs
- DataGridItemEventArgs.cs
- XamlHostingConfiguration.cs
- RtfToken.cs
- MemberPath.cs
- TranslateTransform3D.cs
- HttpHeaderCollection.cs
- Vector3DAnimationBase.cs
- QilGeneratorEnv.cs
- XPathChildIterator.cs
- AlgoModule.cs
- ConnectionPointCookie.cs
- CryptoSession.cs
- SplitterEvent.cs
- ObjectAssociationEndMapping.cs
- UICuesEvent.cs
- WebPartTransformerAttribute.cs
- DataGridViewSelectedCellCollection.cs
- Aggregates.cs
- ApplicationId.cs
- PageAdapter.cs
- DtcInterfaces.cs
- NotSupportedException.cs
- DesignerObject.cs
- XmlQueryType.cs
- HostProtectionException.cs
- FreezableCollection.cs
- ProxyGenerator.cs
- RequestStatusBarUpdateEventArgs.cs
- DigitShape.cs
- OutOfProcStateClientManager.cs
- SingleConverter.cs
- ToolStripDropDownItem.cs
- DrawingGroup.cs
- MissingMethodException.cs
- VBIdentifierDesigner.xaml.cs
- ThicknessConverter.cs
- MouseDevice.cs
- FontFamily.cs
- StateItem.cs
- MultipleCopiesCollection.cs
- XmlEntityReference.cs
- XmlNamespaceDeclarationsAttribute.cs
- SoapMessage.cs
- SqlConnectionPoolGroupProviderInfo.cs
- DesignerContextDescriptor.cs
- Attributes.cs
- LateBoundBitmapDecoder.cs
- HashLookup.cs
- ServiceMetadataPublishingElement.cs
- WithParamAction.cs
- RectAnimationClockResource.cs
- XslAst.cs