BaseWebProxyFinder.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / BaseWebProxyFinder.cs / 1305376 / BaseWebProxyFinder.cs

                            using System; 
using System.Collections.Generic;

namespace System.Net
{ 
    // The purpose of all derived classes of WebProxyFinder is to determine the PAC file location,
    // download and compile the file and then execute it to retrieve the list of proxies for a certain 
    // Uri. 
    internal abstract class BaseWebProxyFinder : IWebProxyFinder
    { 
        private AutoWebProxyState state;
        private AutoWebProxyScriptEngine engine;

        public BaseWebProxyFinder(AutoWebProxyScriptEngine engine) 
        {
            this.engine = engine; 
        } 

        public bool IsValid 
        {
            get { return (state == AutoWebProxyState.Completed) || (state == AutoWebProxyState.Uninitialized); }
        }
 
        public bool IsUnrecognizedScheme
        { 
            get { return state == AutoWebProxyState.UnrecognizedScheme; } 
        }
 
        public abstract bool GetProxies(Uri destination, out IList proxyList);

        public abstract void Abort();
 
        public void Reset()
        { 
            State = AutoWebProxyState.Uninitialized; 
        }
 
        public void Dispose()
        {
            Dispose(true);
        } 

        protected AutoWebProxyState State 
        { 
            get { return state; }
            set { state = value; } 
        }

        protected AutoWebProxyScriptEngine Engine
        { 
            get { return engine; }
        } 
 
        protected abstract void Dispose(bool disposing);
 
        protected enum AutoWebProxyState
        {
            Uninitialized,
            DiscoveryFailure, 
            DownloadFailure,
            CompilationFailure, 
            UnrecognizedScheme, 
            Completed
        } 
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System; 
using System.Collections.Generic;

namespace System.Net
{ 
    // The purpose of all derived classes of WebProxyFinder is to determine the PAC file location,
    // download and compile the file and then execute it to retrieve the list of proxies for a certain 
    // Uri. 
    internal abstract class BaseWebProxyFinder : IWebProxyFinder
    { 
        private AutoWebProxyState state;
        private AutoWebProxyScriptEngine engine;

        public BaseWebProxyFinder(AutoWebProxyScriptEngine engine) 
        {
            this.engine = engine; 
        } 

        public bool IsValid 
        {
            get { return (state == AutoWebProxyState.Completed) || (state == AutoWebProxyState.Uninitialized); }
        }
 
        public bool IsUnrecognizedScheme
        { 
            get { return state == AutoWebProxyState.UnrecognizedScheme; } 
        }
 
        public abstract bool GetProxies(Uri destination, out IList proxyList);

        public abstract void Abort();
 
        public void Reset()
        { 
            State = AutoWebProxyState.Uninitialized; 
        }
 
        public void Dispose()
        {
            Dispose(true);
        } 

        protected AutoWebProxyState State 
        { 
            get { return state; }
            set { state = value; } 
        }

        protected AutoWebProxyScriptEngine Engine
        { 
            get { return engine; }
        } 
 
        protected abstract void Dispose(bool disposing);
 
        protected enum AutoWebProxyState
        {
            Uninitialized,
            DiscoveryFailure, 
            DownloadFailure,
            CompilationFailure, 
            UnrecognizedScheme, 
            Completed
        } 
    }
}

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