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

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

using System; 
using System.Collections.Generic;
using System.Text; 
using System.Xml; 

namespace System.ServiceModel.Security 
{
    public abstract class SecurityPolicyVersion
    {
        readonly String spNamespace; 
        readonly String prefix;
 
        internal SecurityPolicyVersion(String ns, String prefix) 
        {
            this.spNamespace = ns; 
            this.prefix = prefix;
        }

        public String Namespace 
        {
            get 
            { 
                return this.spNamespace;
            } 
        }

        public String Prefix
        { 
            get
            { 
                return this.prefix; 
            }
        } 

        public static SecurityPolicyVersion WSSecurityPolicy11
        {
            get { return WSSecurityPolicyVersion11.Instance; } 
        }
 
        public static SecurityPolicyVersion WSSecurityPolicy12 
        {
            get { return WSSecurityPolicyVersion12.Instance; } 
        }

        class WSSecurityPolicyVersion11 : SecurityPolicyVersion
        { 
            static readonly WSSecurityPolicyVersion11 instance = new WSSecurityPolicyVersion11();
 
            protected WSSecurityPolicyVersion11() 
                : base(System.ServiceModel.Security.WSSecurityPolicy11.WsspNamespace, WSSecurityPolicy.WsspPrefix)
            { 
            }

            public static SecurityPolicyVersion Instance
            { 
                get
                { 
                    return instance; 
                }
            } 
        }

        class WSSecurityPolicyVersion12 : SecurityPolicyVersion
        { 
            static readonly WSSecurityPolicyVersion12 instance = new WSSecurityPolicyVersion12();
 
            protected WSSecurityPolicyVersion12() 
                : base(System.ServiceModel.Security.WSSecurityPolicy12.WsspNamespace, WSSecurityPolicy.WsspPrefix)
            { 
            }

            public static SecurityPolicyVersion Instance
            { 
                get
                { 
                    return instance; 
                }
            } 
        }

    }
} 

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