MsmqTransportElement.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 / MsmqTransportElement.cs / 1 / MsmqTransportElement.cs

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

namespace System.ServiceModel.Configuration 
{
    using System.Configuration; 
    using System.Net.Security; 
    using System.ServiceModel.Channels;
 
    public sealed partial class MsmqTransportElement : MsmqElementBase
    {
        [ConfigurationProperty(ConfigurationStrings.MaxPoolSize, DefaultValue = MsmqDefaults.MaxPoolSize)]
        [IntegerValidator(MinValue = 0)] 
        public int MaxPoolSize
        { 
            get { return (int)base[ConfigurationStrings.MaxPoolSize]; } 
            set { base[ConfigurationStrings.MaxPoolSize] = value; }
        } 

        [ConfigurationProperty(ConfigurationStrings.QueueTransferProtocol, DefaultValue = MsmqDefaults.QueueTransferProtocol)]
        [ServiceModelEnumValidator(typeof(QueueTransferProtocolHelper))]
        public QueueTransferProtocol QueueTransferProtocol 
        {
            get {return (QueueTransferProtocol) base[ConfigurationStrings.QueueTransferProtocol]; } 
            set {base[ConfigurationStrings.QueueTransferProtocol] = value; } 
        }
 
        [ConfigurationProperty(ConfigurationStrings.UseActiveDirectory, DefaultValue = MsmqDefaults.UseActiveDirectory)]
        public bool UseActiveDirectory
        {
            get {return (bool) base[ConfigurationStrings.UseActiveDirectory]; } 
            set {base[ConfigurationStrings.UseActiveDirectory] = value; }
        } 
 
        public override Type BindingElementType
        { 
            get { return typeof(MsmqTransportBindingElement); }
        }

        protected override TransportBindingElement CreateDefaultBindingElement() 
        {
            return new MsmqTransportBindingElement(); 
        } 

 
        public override void ApplyConfiguration(BindingElement bindingElement)
        {
            base.ApplyConfiguration(bindingElement);
 
            MsmqTransportBindingElement binding = bindingElement as MsmqTransportBindingElement;
            binding.MaxPoolSize = this.MaxPoolSize; 
            binding.QueueTransferProtocol = this.QueueTransferProtocol; 
            binding.UseActiveDirectory = this.UseActiveDirectory;
        } 

        public override void CopyFrom(ServiceModelExtensionElement from)
        {
            base.CopyFrom(from); 

            MsmqTransportElement source = from as MsmqTransportElement; 
            if (null != source) 
            {
                this.MaxPoolSize = source.MaxPoolSize; 
                this.QueueTransferProtocol = source.QueueTransferProtocol;
                this.UseActiveDirectory = source.UseActiveDirectory;
            }
        } 

        protected internal override void InitializeFrom(BindingElement bindingElement) 
        { 
            base.InitializeFrom(bindingElement);
            MsmqTransportBindingElement binding = bindingElement as MsmqTransportBindingElement; 
            this.MaxPoolSize = binding.MaxPoolSize;
            this.QueueTransferProtocol = binding.QueueTransferProtocol;
            this.UseActiveDirectory = binding.UseActiveDirectory;
        } 
    }
} 
 

 

// 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