Merge pull request #2171 from lambdageek/dev/fix-marshal
[mono.git] / mcs / class / System / System.Net / GlobalProxySelection.cs
index 2cde423649bdf667730aa022d794aa5d7e820a0e..049f61ccad047c2331a06cc0ef2148213cb88bb9 100644 (file)
@@ -31,15 +31,11 @@ using System.Collections;
 using System.Configuration;
 using System.IO;
 using System.Runtime.Serialization;
-#if NET_2_0
 using System.Net.Configuration;
-#endif
 
 namespace System.Net 
 {
-#if NET_2_0
        [ObsoleteAttribute("Use WebRequest.DefaultProxy instead")]
-#endif
        public class GlobalProxySelection
        {
                // Constructors
@@ -47,39 +43,9 @@ namespace System.Net
                
                // Properties
 
-#if !NET_2_0
-               volatile static IWebProxy proxy;
-               static readonly object lockobj = new object ();
-               
-               static IWebProxy GetProxy ()
-               {
-                       lock (lockobj) {
-                               if (proxy != null)
-                                       return proxy;
-
-                               object p = ConfigurationSettings.GetConfig ("system.net/defaultProxy");
-                               if (p == null)
-                                       p = new EmptyWebProxy ();
-                               proxy = (IWebProxy) p;
-                       }
-
-                       return proxy;
-               }
-#endif
-               
                public static IWebProxy Select {
-#if NET_2_0
                        get { return WebRequest.DefaultWebProxy; }
                        set { WebRequest.DefaultWebProxy = value; }
-#else
-                       get { return GetProxy (); }
-                       set {
-                               if (value == null)
-                                       throw new ArgumentNullException ("GlobalProxySelection.Select",
-                                                       "null IWebProxy not allowed. Use GetEmptyWebProxy ()");
-                               proxy = value; 
-                       }
-#endif
                }
                
                // Methods