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

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

namespace System.ServiceModel.Configuration 
{
    using System; 
    using System.Configuration; 
    using System.ServiceModel.Security.Tokens;
    using System.Xml; 
    using System.Globalization;

    public sealed partial class ClaimTypeElement : ConfigurationElement
    { 
        public ClaimTypeElement()
        { 
        } 

        public ClaimTypeElement(string claimType, bool isOptional) 
        {
            this.ClaimType = claimType;
            this.IsOptional = isOptional;
        } 

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

        [ConfigurationProperty(ConfigurationStrings.IsOptional, DefaultValue = ClaimTypeRequirement.DefaultIsOptional)]
        public bool IsOptional 
        {
            get { return (bool)base[ConfigurationStrings.IsOptional]; } 
            set { base[ConfigurationStrings.IsOptional] = value; } 
        }
    } 
}


 

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