Marek Safar 13 роки тому
батько
коміт
5aeeb9cf7b

+ 4 - 0
mcs/class/System/System.Diagnostics/Process.cs

@@ -75,7 +75,9 @@ namespace System.Diagnostics {
 		IntPtr process_handle;
 		int pid;
 		bool enableRaisingEvents;
+#if !NET_2_1		
 		bool already_waiting;
+#endif
 		ISynchronizeInvoke synchronizingObject;
 		EventHandler exited_event;
 		IntPtr stdout_rd;
@@ -1606,7 +1608,9 @@ namespace System.Diagnostics {
 		static void CBOnExit (object state, bool unused)
 		{
 			Process p = (Process) state;
+#if !NET_2_1			
 			p.already_waiting = false;
+#endif
 			p.OnExited ();
 		}
 

+ 2 - 0
mcs/class/System/System.Diagnostics/ProcessModuleCollection.cs

@@ -58,6 +58,7 @@ namespace System.Diagnostics
 			InnerList.AddRange (processModules);
 		}
 		
+#if !NET_2_1		
 		public ProcessModule this[int index] {
 			get {
 				return (ProcessModule)InnerList[index];
@@ -78,5 +79,6 @@ namespace System.Diagnostics
 		{
 			return InnerList.IndexOf (module);
 		}
+#endif
 	}
 }

+ 3 - 1
mcs/class/System/System.Diagnostics/ProcessThreadCollection.cs

@@ -68,7 +68,8 @@ namespace System.Diagnostics
 		{
 			InnerList.AddRange (processThreads);
 		}
-		
+
+#if !NET_2_1		
 		public ProcessThread this[int index] {
 			get {
 				return (ProcessThread)InnerList[index];
@@ -104,5 +105,6 @@ namespace System.Diagnostics
 		{
 			InnerList.Remove (thread);
 		}
+#endif
 	}
 }

+ 2 - 0
mcs/class/System/System.Net/FtpWebRequest.cs

@@ -173,6 +173,7 @@ namespace System.Net
 			}
 		}
 
+#if !NET_2_1
 		[MonoTODO]
 		public static new RequestCachePolicy DefaultCachePolicy
 		{
@@ -183,6 +184,7 @@ namespace System.Net
 				throw GetMustImplement ();
 			}
 		}
+#endif
 
 		public bool EnableSsl {
 			get {

+ 3 - 0
mcs/class/System/System.Net/HttpWebRequest.cs

@@ -312,6 +312,8 @@ namespace System.Net
 			}
 		}
 #endif
+
+#if !NET_2_1
 		[MonoTODO]
 		public static new RequestCachePolicy DefaultCachePolicy
 		{
@@ -322,6 +324,7 @@ namespace System.Net
 				throw GetMustImplement ();
 			}
 		}
+#endif
 		
 		[MonoTODO]
 		public static int DefaultMaximumErrorResponseLength

+ 4 - 3
mcs/class/System/System.Net/ServicePointManager.cs

@@ -333,11 +333,12 @@ namespace System.Net
 				if (maxServicePoints > 0 && servicePoints.Count >= maxServicePoints)
 					throw new InvalidOperationException ("maximum number of service points reached");
 
-				string addr = address.ToString ();
+				int limit;
 #if NET_2_1
-				int limit = defaultConnectionLimit;
+				limit = defaultConnectionLimit;
 #else
-				int limit = (int) manager.GetMaxConnections (addr);
+				string addr = address.ToString ();
+				limit = (int) manager.GetMaxConnections (addr);
 #endif
 				sp = new ServicePoint (address, limit, maxServicePointIdleTime);
 				sp.Expect100Continue = expectContinue;

+ 13 - 9
mcs/class/System/System.Net/WebRequest.cs

@@ -58,8 +58,10 @@ namespace System.Net
 		static HybridDictionary prefixes = new HybridDictionary ();
 		static bool isDefaultWebProxySet;
 		static IWebProxy defaultWebProxy;
+
+#if !NET_2_1		
 		static RequestCachePolicy defaultCachePolicy;
-		
+#endif		
 		// Constructors
 		
 		static WebRequest ()
@@ -114,14 +116,6 @@ namespace System.Net
 				authentication_level = value;
 			}
 		}
-
-		[MonoTODO ("Implement the caching system. Currently always returns a policy with the NoCacheNoStore level")]
-		public virtual RequestCachePolicy CachePolicy
-		{
-			get { return DefaultCachePolicy; }
-			set {
-			}
-		}
 		
 		public virtual string ConnectionGroupName {
 			get { throw GetMustImplement (); }
@@ -143,6 +137,15 @@ namespace System.Net
 			set { throw GetMustImplement (); }
 		}
 
+#if !NET_2_1
+		[MonoTODO ("Implement the caching system. Currently always returns a policy with the NoCacheNoStore level")]
+		public virtual RequestCachePolicy CachePolicy
+		{
+			get { return DefaultCachePolicy; }
+			set {
+			}
+		}
+		
 		public static RequestCachePolicy DefaultCachePolicy
 		{
 			get { return defaultCachePolicy; }
@@ -150,6 +153,7 @@ namespace System.Net
 				throw GetMustImplement ();
 			}
 		}
+#endif
 		
 		public virtual WebHeaderCollection Headers { 
 			get { throw GetMustImplement (); }

+ 7 - 5
mcs/class/System/System/UriTypeConverter.cs

@@ -89,12 +89,14 @@ namespace System {
 				return value;
 
 			string s = (value as string);
-			if (s != null)
+			if (s != null) {
 #if NET_2_1
 				if (s == "")
 					return null;
 #endif
 				return new Uri (s, UriKind.RelativeOrAbsolute);
+			}
+
 #if !NET_2_1
 			InstanceDescriptor id = (value as InstanceDescriptor);
 			if (id != null) {
@@ -122,14 +124,14 @@ namespace System {
 				}
 #else
 				throw new NotSupportedException (Locale.GetText ("Cannot convert to destination type."));
-#endif
-			} else {
-#if NET_2_1
-				throw new NotSupportedException (Locale.GetText ("Cannot convert to destination type."));
 #endif
 			}
 
+#if NET_2_1
+			throw new NotSupportedException (Locale.GetText ("Cannot convert to destination type."));
+#else
 			return base.ConvertTo (context, culture, value, destinationType);
+#endif
 		}
 
 #if !NET_2_1