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

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

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

    public partial class TransactionFlowElement : BindingElementExtensionElement 
    { 
        public TransactionFlowElement()
        { 
        }

        public override void ApplyConfiguration(BindingElement bindingElement)
        { 
            base.ApplyConfiguration(bindingElement);
            TransactionFlowBindingElement binding = (TransactionFlowBindingElement)bindingElement; 
            binding.Transactions = true; 
            binding.TransactionProtocol = this.TransactionProtocol;
        } 

        [ConfigurationProperty(ConfigurationStrings.TransactionProtocol, DefaultValue = TransactionFlowDefaults.TransactionProtocolString)]
        [TypeConverter(typeof(TransactionProtocolConverter))]
        public TransactionProtocol TransactionProtocol 
        {
            get { return (TransactionProtocol)base[ConfigurationStrings.TransactionProtocol]; } 
            set { base[ConfigurationStrings.TransactionProtocol] = value; } 
        }
 
        public override Type BindingElementType
        {
            get { return typeof(TransactionFlowBindingElement); }
        } 

        public override void CopyFrom(ServiceModelExtensionElement from) 
        { 
            base.CopyFrom(from);
            TransactionFlowElement source = (TransactionFlowElement)from; 
#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
            this.TransactionProtocol = source.TransactionProtocol;
        }
 
        override protected internal BindingElement CreateBindingElement()
        { 
            return new TransactionFlowBindingElement(true, TransactionProtocol); 
        }
 
        protected internal override void InitializeFrom(BindingElement bindingElement)
        {
            base.InitializeFrom(bindingElement);
            TransactionFlowBindingElement binding = (TransactionFlowBindingElement)bindingElement; 
            this.TransactionProtocol = binding.TransactionProtocol;
        } 
    } 
}
 



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