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

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

namespace System.ServiceModel.Activation 
{
    using System.Collections.Generic; 
    using System.Collections.ObjectModel; 
    using System.ServiceModel.Channels;
 
    public sealed class VirtualPathExtension : IExtension
    {
        string virtualPath;
 
        internal VirtualPathExtension(string virtualPath)
        { 
            this.virtualPath = virtualPath; 
        }
 
        public string VirtualPath
        {
            get { return this.virtualPath; }
        } 

        public void Attach(ServiceHostBase owner) 
        {} 

        public void Detach(ServiceHostBase owner) 
        {
            throw new InvalidOperationException(SR.GetString(SR.Hosting_VirtualPathExtenstionCanNotBeDetached));
        }
 
        internal static void ApplyHostedContext(
            TransportChannelListener listener, BindingContext context) 
        { 
            VirtualPathExtension virtualPathExtension = context.BindingParameters.Find();
 
            if (virtualPathExtension != null)
            {
                HostedMetadataProperty metadataProperty = context.BindingParameters.Find();
                listener.ApplyHostedContext(virtualPathExtension, metadataProperty != null); 
            }
        } 
    } 

    // This class is intended to be empty. 
    class HostedMetadataProperty
    { }
}

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