ChannelPoolSettingsElement.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Configuration / ChannelPoolSettingsElement.cs / 1 / ChannelPoolSettingsElement.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------

namespace System.ServiceModel.Configuration 
{
    using System.Configuration; 
    using System.ServiceModel.Channels; 
    using System.Globalization;
    using System.Net.Security; 
    using System.ServiceModel.Security;
    using System.ComponentModel;

 
    public sealed partial class ChannelPoolSettingsElement : ConfigurationElement
    { 
        public ChannelPoolSettingsElement() 
        {
        } 

        [ConfigurationProperty(ConfigurationStrings.IdleTimeout, DefaultValue = OneWayDefaults.IdleTimeoutString)]
        [TypeConverter(typeof(TimeSpanOrInfiniteConverter))]
        [ServiceModelTimeSpanValidator(MinValueString = ConfigurationStrings.TimeSpanZero)] 
        public TimeSpan IdleTimeout
        { 
            get { return (TimeSpan)base[ConfigurationStrings.IdleTimeout]; } 
            set { base[ConfigurationStrings.IdleTimeout] = value; }
        } 

        [ConfigurationProperty(ConfigurationStrings.LeaseTimeout, DefaultValue = OneWayDefaults.LeaseTimeoutString)]
        [TypeConverter(typeof(TimeSpanOrInfiniteConverter))]
        [ServiceModelTimeSpanValidator(MinValueString = ConfigurationStrings.TimeSpanZero)] 
        public TimeSpan LeaseTimeout
        { 
            get { return (TimeSpan)base[ConfigurationStrings.LeaseTimeout]; } 
            set { base[ConfigurationStrings.LeaseTimeout] = value; }
        } 

        [ConfigurationProperty(ConfigurationStrings.MaxOutboundChannelsPerEndpoint, DefaultValue = OneWayDefaults.MaxOutboundChannelsPerEndpoint)]
        [IntegerValidator(MinValue = 1)]
        public int MaxOutboundChannelsPerEndpoint 
        {
            get { return (int)base[ConfigurationStrings.MaxOutboundChannelsPerEndpoint]; } 
            set { base[ConfigurationStrings.MaxOutboundChannelsPerEndpoint] = value; } 
        }
 
        internal void ApplyConfiguration(ChannelPoolSettings settings)
        {
            if (null == settings)
            { 
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("settings");
            } 
 
            settings.IdleTimeout = this.IdleTimeout;
            settings.LeaseTimeout = this.LeaseTimeout; 
            settings.MaxOutboundChannelsPerEndpoint = this.MaxOutboundChannelsPerEndpoint;
        }

        internal void InitializeFrom(ChannelPoolSettings settings) 
        {
            if (null == settings) 
            { 
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("settings");
            } 

            this.IdleTimeout = settings.IdleTimeout;
            this.LeaseTimeout = settings.LeaseTimeout;
            this.MaxOutboundChannelsPerEndpoint = settings.MaxOutboundChannelsPerEndpoint; 
        }
 
        internal void CopyFrom(ChannelPoolSettingsElement source) 
        {
            if (null == source) 
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("source");
            }
 
            this.IdleTimeout = source.IdleTimeout;
            this.LeaseTimeout = source.LeaseTimeout; 
            this.MaxOutboundChannelsPerEndpoint = source.MaxOutboundChannelsPerEndpoint; 
        }
    } 
}


 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK