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
- WindowsListBox.cs
- ImageCodecInfoPrivate.cs
- Trustee.cs
- BitmapVisualManager.cs
- MultilineStringConverter.cs
- OracleString.cs
- BoundColumn.cs
- x509store.cs
- UIElementCollection.cs
- WebPartEditVerb.cs
- UniqueConstraint.cs
- PocoPropertyAccessorStrategy.cs
- _LocalDataStoreMgr.cs
- PropertyOrder.cs
- Thumb.cs
- EventItfInfo.cs
- DataGridViewControlCollection.cs
- WebPartExportVerb.cs
- ParameterToken.cs
- XmlDataSourceNodeDescriptor.cs
- TextStore.cs
- Matrix3DValueSerializer.cs
- SafeLibraryHandle.cs
- Utils.cs
- DEREncoding.cs
- MailAddress.cs
- ConnectionManagementElement.cs
- PropertyIDSet.cs
- PipeStream.cs
- WizardStepBase.cs
- DataGridCommandEventArgs.cs
- ExpandSegmentCollection.cs
- TransformPatternIdentifiers.cs
- DataGridViewAutoSizeModeEventArgs.cs
- Pair.cs
- LeftCellWrapper.cs
- KeyboardEventArgs.cs
- ReceiveContent.cs
- PageCache.cs
- SafeFileMappingHandle.cs
- SizeF.cs
- HttpListener.cs
- WebPartTransformer.cs
- Grid.cs
- TreeView.cs
- JsonEnumDataContract.cs
- XmlDigitalSignatureProcessor.cs
- UmAlQuraCalendar.cs
- XmlDocument.cs
- TextRenderer.cs
- BypassElementCollection.cs
- MessageDroppedTraceRecord.cs
- MergablePropertyAttribute.cs
- TagPrefixInfo.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- ConfigLoader.cs
- LinqDataSourceDisposeEventArgs.cs
- ListBase.cs
- SuppressMessageAttribute.cs
- Geometry3D.cs
- ResourcePool.cs
- IndexedGlyphRun.cs
- RegexCapture.cs
- HtmlInputHidden.cs
- StylusPointDescription.cs
- PhysicalFontFamily.cs
- TemplateControlParser.cs
- OleDbError.cs
- DocumentCollection.cs
- figurelengthconverter.cs
- Executor.cs
- Viewport2DVisual3D.cs
- Int32Storage.cs
- ActivityDesigner.cs
- GregorianCalendar.cs
- RequiredAttributeAttribute.cs
- AnnotationComponentManager.cs
- JoinTreeSlot.cs
- LocalBuilder.cs
- X509CertificateStore.cs
- ParenExpr.cs
- ExtractedStateEntry.cs
- ZipIOExtraFieldPaddingElement.cs
- ProcessInfo.cs
- ComplexTypeEmitter.cs
- XmlSchemaInferenceException.cs
- _emptywebproxy.cs
- XPathNodeHelper.cs
- LicenseManager.cs
- ContainerControl.cs
- SqlTrackingService.cs
- ServerIdentity.cs
- CachedFontFace.cs
- SignedXml.cs
- TypeResolver.cs
- TraceLevelHelper.cs
- SecurityPermission.cs
- MethodBuilderInstantiation.cs
- ErrorInfoXmlDocument.cs
- UiaCoreApi.cs