RoutingExtension.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Routing / System / ServiceModel / Routing / RoutingExtension.cs / 1305376 / RoutingExtension.cs

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

namespace System.ServiceModel.Routing 
{
    using System; 
    using System.Diagnostics.CodeAnalysis; 
    using System.Runtime;
    using System.ServiceModel; 
    using System.ServiceModel.Dispatcher;

    [Fx.Tag.XamlVisible(false)]
    public sealed class RoutingExtension : IExtension 
    {
        volatile RoutingConfiguration configuration; 
 
        internal RoutingExtension(RoutingConfiguration configuration)
        { 
            Fx.Assert(configuration != null, "Configuration required");

            if (TD.RoutingServiceDisplayConfigIsEnabled())
            { 
                TD.RoutingServiceDisplayConfig(configuration.RouteOnHeadersOnly.ToString(TD.Culture), configuration.SoapProcessingEnabled.ToString(TD.Culture));
            } 
            this.configuration = configuration; 
        }
 
        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUncalledPrivateCode, Justification = "This gets called in RoutingService..ctor")]
        internal RoutingConfiguration RoutingConfiguration
        {
            get 
            {
                return this.configuration; 
            } 
        }
 
        void IExtension.Attach(ServiceHostBase owner)
        {
        }
 
        void IExtension.Detach(ServiceHostBase owner)
        { 
        } 

        public void ApplyConfiguration(RoutingConfiguration routingConfiguration) 
        {
            if (routingConfiguration == null)
            {
                throw FxTrace.Exception.ArgumentNull("routingConfiguration"); 
            }
 
            if (TD.RoutingServiceConfigurationAppliedIsEnabled()) 
            {
                TD.RoutingServiceConfigurationApplied(); 
            }
            if (TD.RoutingServiceDisplayConfigIsEnabled())
            {
                TD.RoutingServiceDisplayConfig(routingConfiguration.RouteOnHeadersOnly.ToString(TD.Culture), routingConfiguration.SoapProcessingEnabled.ToString(TD.Culture)); 
            }
            this.configuration = routingConfiguration; 
        } 
    }
} 

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