ServiceEndpointElement.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 / Configuration / ServiceEndpointElement.cs / 1 / ServiceEndpointElement.cs

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

namespace System.ServiceModel.Configuration 
{
    using System; 
    using System.ServiceModel.Channels; 
    using System.ServiceModel.Description;
    using System.Configuration; 
    using System.Collections.Generic;
    using System.ServiceModel;
    using System.Xml;
    using System.Globalization; 

    public sealed partial class ServiceEndpointElement : ConfigurationElement, IConfigurationContextProviderInternal 
    { 
        public ServiceEndpointElement() : base() {}
 
        public ServiceEndpointElement(Uri address, string contractType) : this()
        {
            this.Address = address;
            this.Contract = contractType; 
        }
 
        [ConfigurationProperty(ConfigurationStrings.Address, DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)] 
        public Uri Address
        { 
            get {return (Uri) base[ConfigurationStrings.Address]; }
            set {base[ConfigurationStrings.Address] = value; }
        }
 
        [ConfigurationProperty(ConfigurationStrings.BehaviorConfiguration, DefaultValue = "")]
        [StringValidator(MinLength = 0)] 
        public string BehaviorConfiguration 
        {
            get {return (string) base[ConfigurationStrings.BehaviorConfiguration]; } 
            set
            {
                if (String.IsNullOrEmpty(value))
                { 
                    value = String.Empty;
                } 
                base[ConfigurationStrings.BehaviorConfiguration] = value; 
            }
        } 

        [ConfigurationProperty(ConfigurationStrings.Binding, Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
        [StringValidator(MinLength = 1)]
        public string Binding 
        {
            get {return (string) base[ConfigurationStrings.Binding]; } 
            set 
            {
                if (String.IsNullOrEmpty(value)) 
                {
                    value = String.Empty;
                }
                base[ConfigurationStrings.Binding] = value; 
            }
        } 
 
        [ConfigurationProperty(ConfigurationStrings.BindingConfiguration, DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)]
        [StringValidator(MinLength = 0)] 
        public string BindingConfiguration
        {
            get {return (string) base[ConfigurationStrings.BindingConfiguration]; }
            set 
            {
                if (String.IsNullOrEmpty(value)) 
                { 
                    value = String.Empty;
                } 
                base[ConfigurationStrings.BindingConfiguration] = value;
            }
        }
 
        [ConfigurationProperty(ConfigurationStrings.Name, DefaultValue = "")]
        [StringValidator(MinLength = 0)] 
        public string Name 
        {
            get { return (string)base[ConfigurationStrings.Name]; } 
            set
            {
                if (String.IsNullOrEmpty(value))
                { 
                    value = string.Empty;
                } 
                base[ConfigurationStrings.Name] = value; 
            }
        } 

        [ConfigurationProperty(ConfigurationStrings.BindingName, DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)]
        [StringValidator(MinLength = 0)]
        public string BindingName 
        {
            get {return (string) base[ConfigurationStrings.BindingName]; } 
            set 
            {
                if (String.IsNullOrEmpty(value)) 
                {
                    value = String.Empty;
                }
                base[ConfigurationStrings.BindingName] = value; 
            }
        } 
 
        [ConfigurationProperty(ConfigurationStrings.BindingNamespace, DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)]
        [StringValidator(MinLength = 0)] 
        public string BindingNamespace
        {
            get {return (string) base[ConfigurationStrings.BindingNamespace]; }
            set 
            {
                if (String.IsNullOrEmpty(value)) 
                { 
                    value = String.Empty;
                } 
                base[ConfigurationStrings.BindingNamespace] = value;
            }
        }
 
        [ConfigurationProperty(ConfigurationStrings.Contract, DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)]
        [StringValidator(MinLength = 0)] 
        public string Contract 
        {
            get {return (string) base[ConfigurationStrings.Contract]; } 
            set
            {
                if (String.IsNullOrEmpty(value))
                { 
                    value = String.Empty;
                } 
                base[ConfigurationStrings.Contract] = value; 
            }
        } 

        [ConfigurationProperty(ConfigurationStrings.Headers)]
        public AddressHeaderCollectionElement Headers
        { 
            get {return (AddressHeaderCollectionElement) base[ConfigurationStrings.Headers]; }
        } 
 
        [ConfigurationProperty(ConfigurationStrings.Identity)]
        public IdentityElement Identity 
        {
            get {return (IdentityElement) base[ConfigurationStrings.Identity]; }
        }
 
        [ConfigurationProperty(ConfigurationStrings.ListenUriMode, DefaultValue = ListenUriMode.Explicit)]
        [ServiceModelEnumValidator(typeof(ListenUriModeHelper))] 
        public ListenUriMode ListenUriMode 
        {
            get { return (ListenUriMode)base[ConfigurationStrings.ListenUriMode]; } 
            set { base[ConfigurationStrings.ListenUriMode] = value; }
        }

        [ConfigurationProperty(ConfigurationStrings.ListenUri, DefaultValue = null)] 
        public Uri ListenUri
        { 
            get { return (Uri)base[ConfigurationStrings.ListenUri]; } 
            set { base[ConfigurationStrings.ListenUri] = value; }
        } 

        ContextInformation IConfigurationContextProviderInternal.GetEvaluationContext()
        {
            return this.EvaluationContext; 
        }
 
        ///  
        ///   RequiresReview - the return value will be used for a security decision -- see comment in interface definition
        ///  
        ContextInformation IConfigurationContextProviderInternal.GetOriginalEvaluationContext()
        {
            DiagnosticUtility.DebugAssert("Not implemented: IConfigurationContextProviderInternal.GetOriginalEvaluationContext");
            return null; 
        }
    } 
} 

 


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