FtpCachePolicyElement.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / Configuration / FtpCachePolicyElement.cs / 1 / FtpCachePolicyElement.cs

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

namespace System.Net.Configuration 
{ 
    using System;
    using System.Configuration; 
    using System.Net.Cache;
    using System.Xml;
    using System.Security.Permissions;
 
    public sealed class FtpCachePolicyElement : ConfigurationElement
    { 
        public FtpCachePolicyElement() 
        {
            this.properties.Add(this.policyLevel); 
        }

        protected override ConfigurationPropertyCollection Properties
        { 
            get
            { 
                return this.properties; 
            }
        } 

        [ConfigurationProperty(ConfigurationStrings.PolicyLevel, DefaultValue = RequestCacheLevel.Default)]
        public RequestCacheLevel PolicyLevel
        { 
            get { return (RequestCacheLevel)this[this.policyLevel]; }
            set { this[this.policyLevel] = value; } 
        } 

 
        protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey)
        {
            wasReadFromConfig = true;
            base.DeserializeElement(reader, serializeCollectionKey); 
        }
 
        protected override void Reset(ConfigurationElement parentElement) 
        {
            if (parentElement != null) 
            {
                FtpCachePolicyElement http = (FtpCachePolicyElement)parentElement;
                this.wasReadFromConfig = http.wasReadFromConfig;
            } 
            base.Reset(parentElement);
        } 
 
        internal bool WasReadFromConfig
        { 
            get { return this.wasReadFromConfig; }
        }

        bool wasReadFromConfig = false; 
        ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
 
        readonly ConfigurationProperty policyLevel = 
            new ConfigurationProperty(ConfigurationStrings.PolicyLevel, typeof(RequestCacheLevel), RequestCacheLevel.Default, ConfigurationPropertyOptions.None);
 
    }

}
 


                        

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