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

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

namespace System.ServiceModel.Configuration 
{
    using System.Configuration; 
    using System.ServiceModel; 
    using System.Globalization;
    using System.ServiceModel.Security; 
    using System.ServiceModel.Channels;
    using System.Net.Security;
    using System.ComponentModel;
 
    public abstract partial class MsmqBindingElementBase : StandardBindingElement
    { 
        protected MsmqBindingElementBase(string name) 
            : base(name)
        { } 

        protected MsmqBindingElementBase()
            : this(null)
        { } 

        [ConfigurationProperty(ConfigurationStrings.CustomDeadLetterQueue, DefaultValue = MsmqDefaults.CustomDeadLetterQueue)] 
        public Uri CustomDeadLetterQueue 
        {
            get { return (Uri)base[ConfigurationStrings.CustomDeadLetterQueue]; } 
            set { base[ConfigurationStrings.CustomDeadLetterQueue] = value; }
        }

        [ConfigurationProperty(ConfigurationStrings.DeadLetterQueue, DefaultValue = MsmqDefaults.DeadLetterQueue)] 
        [ServiceModelEnumValidator(typeof(DeadLetterQueueHelper))]
        public DeadLetterQueue DeadLetterQueue 
        { 
            get { return (DeadLetterQueue)base[ConfigurationStrings.DeadLetterQueue]; }
            set { base[ConfigurationStrings.DeadLetterQueue] = value; } 
        }

        [ConfigurationProperty(ConfigurationStrings.Durable, DefaultValue = MsmqDefaults.Durable)]
        public bool Durable 
        {
            get { return (bool)base[ConfigurationStrings.Durable]; } 
            set { base[ConfigurationStrings.Durable] = value; } 
        }
 
        [ConfigurationProperty(ConfigurationStrings.ExactlyOnce, DefaultValue = MsmqDefaults.ExactlyOnce)]
        public bool ExactlyOnce
        {
            get { return (bool)base[ConfigurationStrings.ExactlyOnce]; } 
            set { base[ConfigurationStrings.ExactlyOnce] = value; }
        } 
 
        [ConfigurationProperty(ConfigurationStrings.MaxReceivedMessageSize, DefaultValue = TransportDefaults.MaxReceivedMessageSize)]
        [LongValidator(MinValue = 0)] 
        public long MaxReceivedMessageSize
        {
            get { return (long)base[ConfigurationStrings.MaxReceivedMessageSize]; }
            set { base[ConfigurationStrings.MaxReceivedMessageSize] = value; } 
        }
 
        [ConfigurationProperty(ConfigurationStrings.MaxRetryCycles, DefaultValue = MsmqDefaults.MaxRetryCycles)] 
        [IntegerValidator(MinValue = 0)]
        public int MaxRetryCycles 
        {
            get { return (int)base[ConfigurationStrings.MaxRetryCycles]; }
            set { base[ConfigurationStrings.MaxRetryCycles] = value; }
        } 

        [ConfigurationProperty(ConfigurationStrings.ReceiveErrorHandling, DefaultValue = MsmqDefaults.ReceiveErrorHandling)] 
        [ServiceModelEnumValidator(typeof(ReceiveErrorHandlingHelper))] 
        public ReceiveErrorHandling ReceiveErrorHandling
        { 
            get { return (ReceiveErrorHandling)base[ConfigurationStrings.ReceiveErrorHandling]; }
            set { base[ConfigurationStrings.ReceiveErrorHandling] = value; }
        }
 
        [ConfigurationProperty(ConfigurationStrings.ReceiveRetryCount, DefaultValue = MsmqDefaults.ReceiveRetryCount)]
        [IntegerValidator(MinValue = 0)] 
        public int ReceiveRetryCount 
        {
            get { return (int)base[ConfigurationStrings.ReceiveRetryCount]; } 
            set { base[ConfigurationStrings.ReceiveRetryCount] = value; }
        }

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

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

        [ConfigurationProperty(ConfigurationStrings.UseSourceJournal, DefaultValue = MsmqDefaults.UseSourceJournal)] 
        public bool UseSourceJournal
        { 
            get { return (bool)base[ConfigurationStrings.UseSourceJournal]; } 
            set { base[ConfigurationStrings.UseSourceJournal] = value; }
        } 

        [ConfigurationProperty(ConfigurationStrings.UseMsmqTracing, DefaultValue = MsmqDefaults.UseMsmqTracing)]
        public bool UseMsmqTracing
        { 
            get { return (bool)base[ConfigurationStrings.UseMsmqTracing]; }
            set { base[ConfigurationStrings.UseMsmqTracing] = value; } 
        } 

        protected internal override void InitializeFrom(Binding binding) 
        {
            base.InitializeFrom(binding);
            MsmqBindingBase msmqBinding = (MsmqBindingBase)binding;
 

            this.DeadLetterQueue = msmqBinding.DeadLetterQueue; 
            if (msmqBinding.CustomDeadLetterQueue != null) 
                this.CustomDeadLetterQueue = msmqBinding.CustomDeadLetterQueue;
            this.Durable = msmqBinding.Durable; 
            this.ExactlyOnce = msmqBinding.ExactlyOnce;
            this.MaxReceivedMessageSize = msmqBinding.MaxReceivedMessageSize;
            this.MaxRetryCycles = msmqBinding.MaxRetryCycles;
            this.ReceiveErrorHandling = msmqBinding.ReceiveErrorHandling; 
            this.ReceiveRetryCount = msmqBinding.ReceiveRetryCount;
            this.RetryCycleDelay = msmqBinding.RetryCycleDelay; 
            this.TimeToLive = msmqBinding.TimeToLive; 
            this.UseSourceJournal = msmqBinding.UseSourceJournal;
            this.UseMsmqTracing = msmqBinding.UseMsmqTracing; 
        }

        protected override void OnApplyConfiguration(Binding binding)
        { 
            MsmqBindingBase msmqBinding = (MsmqBindingBase)binding;
 
            if (this.CustomDeadLetterQueue != null) 
                msmqBinding.CustomDeadLetterQueue = this.CustomDeadLetterQueue;
            msmqBinding.DeadLetterQueue = this.DeadLetterQueue; 
            msmqBinding.Durable = this.Durable;
            msmqBinding.ExactlyOnce = this.ExactlyOnce;
            msmqBinding.MaxReceivedMessageSize = this.MaxReceivedMessageSize;
            msmqBinding.MaxRetryCycles = this.MaxRetryCycles; 
            msmqBinding.ReceiveErrorHandling = this.ReceiveErrorHandling;
            msmqBinding.ReceiveRetryCount = this.ReceiveRetryCount; 
            msmqBinding.RetryCycleDelay = this.RetryCycleDelay; 
            msmqBinding.TimeToLive = this.TimeToLive;
            msmqBinding.UseSourceJournal = this.UseSourceJournal; 
            msmqBinding.UseMsmqTracing = this.UseMsmqTracing;
        }
    }
} 

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