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
- Mappings.cs
- PerspectiveCamera.cs
- FlowDocumentReader.cs
- PrimitiveXmlSerializers.cs
- SqlConnectionString.cs
- FormsAuthenticationUser.cs
- DurableEnlistmentState.cs
- WindowsListViewSubItem.cs
- TreeViewEvent.cs
- BamlLocalizableResource.cs
- ImageConverter.cs
- TreeView.cs
- LocatorPartList.cs
- TextViewBase.cs
- entitydatasourceentitysetnameconverter.cs
- DataGridViewLinkColumn.cs
- EventLogPermissionEntryCollection.cs
- EnumBuilder.cs
- ArglessEventHandlerProxy.cs
- PropertyGeneratedEventArgs.cs
- InstallerTypeAttribute.cs
- RegexWriter.cs
- CacheVirtualItemsEvent.cs
- ClientBuildManagerCallback.cs
- OdbcCommand.cs
- CodeAccessSecurityEngine.cs
- XpsFont.cs
- Hex.cs
- StateBag.cs
- Schema.cs
- RepeatButton.cs
- BypassElement.cs
- Stroke2.cs
- WebBrowserNavigatedEventHandler.cs
- CharacterString.cs
- StorageTypeMapping.cs
- Processor.cs
- PointAnimation.cs
- _LoggingObject.cs
- Pkcs7Recipient.cs
- TemplateParser.cs
- EncoderParameters.cs
- AdornerLayer.cs
- VirtualDirectoryMappingCollection.cs
- HttpCacheVary.cs
- XpsManager.cs
- SByte.cs
- ActivityXamlServices.cs
- CacheVirtualItemsEvent.cs
- EntitySqlQueryBuilder.cs
- ListBoxChrome.cs
- SqlCommand.cs
- BuildResultCache.cs
- XmlWrappingReader.cs
- EntityViewGenerationConstants.cs
- SmiContext.cs
- CurrentTimeZone.cs
- MarshalByRefObject.cs
- SourceFileInfo.cs
- ReadOnlyDictionary.cs
- MessageQueuePermission.cs
- DropShadowEffect.cs
- LinkUtilities.cs
- HttpClientChannel.cs
- ResourcesChangeInfo.cs
- BaseCodeDomTreeGenerator.cs
- DbConnectionPoolCounters.cs
- ZoneMembershipCondition.cs
- DeleteCardRequest.cs
- TemplateBindingExtensionConverter.cs
- EventMappingSettings.cs
- regiisutil.cs
- LinkedList.cs
- PenLineJoinValidation.cs
- SearchForVirtualItemEventArgs.cs
- XmlMapping.cs
- ComboBoxAutomationPeer.cs
- CallTemplateAction.cs
- DispatcherExceptionFilterEventArgs.cs
- basenumberconverter.cs
- UdpConstants.cs
- Types.cs
- FastEncoderWindow.cs
- FormView.cs
- VectorCollection.cs
- ResourceContainer.cs
- recordstatescratchpad.cs
- AddInServer.cs
- EncodingInfo.cs
- UdpContractFilterBehavior.cs
- IdentifierService.cs
- Task.cs
- XmlSchemaCollection.cs
- PreviewPageInfo.cs
- DataColumnMapping.cs
- ByteBufferPool.cs
- Memoizer.cs
- PerformanceCounterPermissionAttribute.cs
- LinqDataSourceHelper.cs
- PriorityItem.cs