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

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

namespace System.ServiceModel.Channels 
{
    using System.Collections.Generic; 
    using System.Diagnostics; 
    using System.IO;
    using System.Net; 
    using System.ServiceModel.Diagnostics;
    using System.Text;
    using System.Threading;
    using System.Web; 
    using System.Web.Hosting;
    using System.Globalization; 
    using System.ServiceModel.Activation; 

    abstract class MsmqBindingFilter 
    {
        string prefix;
        MsmqUri.IAddressTranslator addressing;
 
        public MsmqBindingFilter(string path, MsmqUri.IAddressTranslator addressing)
        { 
            this.prefix = path; 
            this.addressing = addressing;
 
            // Construct the canonical prefix.  It's the
            // app name with no slashes at beginning or end:
            if(this.prefix.Length > 0 && this.prefix[0] == '/')
            { 
                this.prefix = this.prefix.Substring(1);
            } 
            if(this.prefix.Length > 0 && this.prefix[this.prefix.Length-1] != '/') 
            {
                this.prefix = this.prefix + '/'; 
            }
        }

        public string CanonicalPrefix 
        {
            get { return this.prefix; } 
        } 

        public int Match(string name) 
        {
            if(string.Compare(CanonicalPrefix, 0, name, 0, CanonicalPrefix.Length, StringComparison.OrdinalIgnoreCase) == 0)
            {
                return CanonicalPrefix.Length; 
            }
 
            return -1; 
        }
 
        public Uri CreateServiceUri(string host, string name, bool isPrivate)
        {
            return addressing.CreateUri(host, name, isPrivate);
        } 

        public abstract object MatchFound(string host, string name, bool isPrivate); 
        public abstract void MatchLost(string host, string name, bool isPrivate, object callbackState); 
    }
} 

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