TransactionBridgeSection.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 / TransactionBridge / Microsoft / Transactions / Bridge / Configuration / TransactionBridgeSection.cs / 1 / TransactionBridgeSection.cs

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

namespace Microsoft.Transactions.Bridge.Configuration 
{
    using System; 
    using System.Configuration; 
    using System.Globalization;
 
    internal sealed partial class TransactionBridgeSection : ConfigurationSection
    {

        public TransactionBridgeSection() 
            : this(false)
        { 
        } 

        internal TransactionBridgeSection(bool setDefaults) 
            : base()
        {
            if (setDefaults)
            { 
                this.Protocols.SetDefaults();
            } 
        } 

        [ConfigurationProperty(ConfigurationStrings.Protocols, DefaultValue = null, Options = ConfigurationPropertyOptions.None)] 
        public ProtocolElementCollection Protocols
        {
            get { return (ProtocolElementCollection)base[ConfigurationStrings.Protocols]; }
        } 

        [ConfigurationProperty(ConfigurationStrings.TransactionManagerType, DefaultValue = TransactionBridgeSection.dtcGatewayType, Options = ConfigurationPropertyOptions.None)] 
        [StringValidator(MinLength = 0)] 
        public string TransactionManagerType
        { 
            get { return (string)base[ConfigurationStrings.TransactionManagerType]; }
            set
            {
                if (String.IsNullOrEmpty(value)) 
                {
                    value = String.Empty; 
                } 
                base[ConfigurationStrings.TransactionManagerType] = value;
            } 
        }

        protected override void Reset(ConfigurationElement parentElement)
        { 
            if (parentElement == null)
            { 
                parentElement = new TransactionBridgeSection(true); 
            }
            base.Reset(parentElement); 
        }

        static internal TransactionBridgeSection GetSection()
        { 
            TransactionBridgeSection retval = ConfigurationStrings.GetSection(ConfigurationStrings.GetSectionPath(ConfigurationStrings.TransactionBridgeSectionName)) as TransactionBridgeSection;
            if (retval == null) 
            { 
                retval = new TransactionBridgeSection(true);
            } 
            return retval;
        }

        const string dtcGatewayType = ("Microsoft.Transactions.Bridge.Dtc.GatewayTransactionManager, " + 
                                       "Microsoft.Transactions.Bridge.Dtc, " +
                                       "Version=" + ThisAssembly.Version + ", " + 
                                       "Culture=neutral, " + 
                                       "PublicKeyToken=" + AssemblyRef.MicrosoftPublicKey);
    } 
}



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