RoutingConfiguration.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 / RoutingConfiguration.cs / 1305376 / RoutingConfiguration.cs

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

namespace System.ServiceModel.Routing 
{
    using System.Collections.Generic; 
    using System.Configuration; 
    using System.Diagnostics.CodeAnalysis;
    using System.Runtime; 
    using System.ServiceModel.Description;
    using System.ServiceModel.Dispatcher;

    [Fx.Tag.XamlVisible(false)] 
    public sealed class RoutingConfiguration
    { 
        internal const bool DefaultRouteOnHeadersOnly = true; 
        internal const bool DefaultSoapProcessingEnabled = true;
        bool configured; 
        MessageFilterTable> filterTable;

        public RoutingConfiguration()
            : this(new MessageFilterTable>(), DefaultRouteOnHeadersOnly) 
        {
            this.configured = false; 
        } 

        public RoutingConfiguration (MessageFilterTable> filterTable, bool routeOnHeadersOnly) 
 	    {
            if (filterTable == null)
            {
                throw FxTrace.Exception.ArgumentNull("filterTable"); 
            }
            this.configured = true; //User handed us the FilterTable, assume it's valid/configured 
            this.filterTable = filterTable; 
            this.RouteOnHeadersOnly = routeOnHeadersOnly;
            this.SoapProcessingEnabled = DefaultSoapProcessingEnabled; 
	    }

        public MessageFilterTable> FilterTable
        { 
            get
            { 
                this.configured = true; 
                return this.filterTable;
            } 
        }

        internal MessageFilterTable> InternalFilterTable
        { 
            get
            { 
                return this.filterTable; 
            }
        } 

        public bool RouteOnHeadersOnly
        {
            get; 
            set;
        } 
 
        public bool SoapProcessingEnabled
        { 
            get;
            set;
        }
 
        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUncalledPrivateCode, Justification = "This gets called in RoutingService..ctor")]
        internal void VerifyConfigured() 
        { 
            if (!this.configured)
            { 
                throw FxTrace.Exception.AsError(new ConfigurationErrorsException(SR.RoutingTableNotConfigured));
            }
        }
    } 
}

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