2 // System.Net.GlobalProxySelection
\r
5 // Lawrence Pit (loz@cable.a2000.nl)
\r
9 using System.Collections;
\r
11 using System.Runtime.Serialization;
\r
13 namespace System.Net
\r
15 public class GlobalProxySelection
\r
17 private static IWebProxy proxy;
\r
19 // Static Initializer
\r
21 static GlobalProxySelection ()
\r
23 proxy = GetEmptyWebProxy ();
\r
25 // TODO: create proxy object based on information from
\r
26 // the global or application configuration file.
\r
31 public GlobalProxySelection() { }
\r
35 public static IWebProxy Select {
\r
36 get { return proxy; }
\r
38 proxy = (value == null) ? GetEmptyWebProxy () : value;
\r
44 public static IWebProxy GetEmptyWebProxy()
\r
46 // must return a new one each time, as the credentials
\r
48 return new EmptyWebProxy ();
\r
53 internal class EmptyWebProxy : IWebProxy {
\r
54 private ICredentials credentials = null;
\r
56 internal EmptyWebProxy () { }
\r
58 public ICredentials Credentials {
\r
59 get { return credentials; }
\r
60 set { credentials = value; }
\r
63 public Uri GetProxy (Uri destination)
\r
68 public bool IsBypassed (Uri host)
\r
70 return true; // pass directly to host
\r