mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
Adding reference source for System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Entity.Design System.Data.Linq System.Data.SqlXml System.ServiceModel System.ServiceModel.Activation System.ServiceModel.Activities System.ServiceModel.Channels System.ServiceModel.Discovery System.ServiceModel.Internals System.ServiceModel.Routing System.ServiceModel.WasHosting System.ServiceModel.Web System.Web System.Web.ApplicationServices System.Web.DynamicData System.Web.Entity System.Web.Entity.Design System.Web.Extensions System.Web.Mobile System.Web.Routing System.Web.Services System.Xml System.Xml.Linq
66 lines
2.5 KiB
C#
66 lines
2.5 KiB
C#
//------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//------------------------------------------------------------
|
|
namespace System.ServiceModel.Description
|
|
{
|
|
using System.Runtime;
|
|
using System.ServiceModel;
|
|
using System.ServiceModel.Channels;
|
|
using System.ServiceModel.Dispatcher;
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|