DbConnectionPoolOptions.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / ProviderBase / DbConnectionPoolOptions.cs / 1305376 / DbConnectionPoolOptions.cs

                            //------------------------------------------------------------------------------ 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// [....] 
//-----------------------------------------------------------------------------
 
namespace System.Data.ProviderBase { 

    using System; 
    using System.Diagnostics;

    internal sealed class DbConnectionPoolGroupOptions {
 
        private readonly bool       _poolByIdentity;
        private readonly int        _minPoolSize; 
        private readonly int        _maxPoolSize; 
        private readonly int        _creationTimeout;
        private readonly TimeSpan   _loadBalanceTimeout; 
        private readonly bool       _hasTransactionAffinity;
        private readonly bool       _useDeactivateQueue;
        private readonly bool       _useLoadBalancing;
 
        public DbConnectionPoolGroupOptions(
                                        bool poolByIdentity, 
                                        int minPoolSize, 
                                        int maxPoolSize,
                                        int creationTimeout, 
                                        int loadBalanceTimeout,
                                        bool hasTransactionAffinity,
                                        bool useDeactivateQueue ) {
            _poolByIdentity = poolByIdentity; 
            _minPoolSize = minPoolSize;
            _maxPoolSize = maxPoolSize; 
            _creationTimeout = creationTimeout; 

            if (0 != loadBalanceTimeout) { 
                _loadBalanceTimeout = new TimeSpan(0, 0, loadBalanceTimeout);
                _useLoadBalancing = true;
            }
 
            _hasTransactionAffinity = hasTransactionAffinity;
            _useDeactivateQueue = useDeactivateQueue; 
        } 

        public int CreationTimeout { 
            get { return _creationTimeout; }
        }
        public bool HasTransactionAffinity {
            get { return _hasTransactionAffinity; } 
        }
        public TimeSpan LoadBalanceTimeout { 
            get { return _loadBalanceTimeout; } 
        }
        public int MaxPoolSize { 
            get { return _maxPoolSize; }
        }
        public int MinPoolSize {
            get { return _minPoolSize; } 
        }
        public bool PoolByIdentity { 
            get { return _poolByIdentity; } 
        }
        public bool UseDeactivateQueue { 
            get { return _useDeactivateQueue; }
        }
        public bool UseLoadBalancing {
            get { return _useLoadBalancing; } 
        }
    } 
} 

 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// [....] 
//-----------------------------------------------------------------------------
 
namespace System.Data.ProviderBase { 

    using System; 
    using System.Diagnostics;

    internal sealed class DbConnectionPoolGroupOptions {
 
        private readonly bool       _poolByIdentity;
        private readonly int        _minPoolSize; 
        private readonly int        _maxPoolSize; 
        private readonly int        _creationTimeout;
        private readonly TimeSpan   _loadBalanceTimeout; 
        private readonly bool       _hasTransactionAffinity;
        private readonly bool       _useDeactivateQueue;
        private readonly bool       _useLoadBalancing;
 
        public DbConnectionPoolGroupOptions(
                                        bool poolByIdentity, 
                                        int minPoolSize, 
                                        int maxPoolSize,
                                        int creationTimeout, 
                                        int loadBalanceTimeout,
                                        bool hasTransactionAffinity,
                                        bool useDeactivateQueue ) {
            _poolByIdentity = poolByIdentity; 
            _minPoolSize = minPoolSize;
            _maxPoolSize = maxPoolSize; 
            _creationTimeout = creationTimeout; 

            if (0 != loadBalanceTimeout) { 
                _loadBalanceTimeout = new TimeSpan(0, 0, loadBalanceTimeout);
                _useLoadBalancing = true;
            }
 
            _hasTransactionAffinity = hasTransactionAffinity;
            _useDeactivateQueue = useDeactivateQueue; 
        } 

        public int CreationTimeout { 
            get { return _creationTimeout; }
        }
        public bool HasTransactionAffinity {
            get { return _hasTransactionAffinity; } 
        }
        public TimeSpan LoadBalanceTimeout { 
            get { return _loadBalanceTimeout; } 
        }
        public int MaxPoolSize { 
            get { return _maxPoolSize; }
        }
        public int MinPoolSize {
            get { return _minPoolSize; } 
        }
        public bool PoolByIdentity { 
            get { return _poolByIdentity; } 
        }
        public bool UseDeactivateQueue { 
            get { return _useDeactivateQueue; }
        }
        public bool UseLoadBalancing {
            get { return _useLoadBalancing; } 
        }
    } 
} 

 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

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