2
0
Эх сурвалжийг харах

1.1 code removal for System.Web/*

svn path=/trunk/mcs/; revision=144494
Marek Habersack 16 жил өмнө
parent
commit
7348f91e0a
68 өөрчлөгдсөн 314 нэмэгдсэн , 992 устгасан
  1. 1 13
      mcs/class/System.Web/Assembly/AssemblyInfo.cs
  2. 5 6
      mcs/class/System.Web/System.Web/ApplicationShutdownReason.cs
  3. 0 2
      mcs/class/System.Web/System.Web/BaseParamsCollection.cs
  4. 7 28
      mcs/class/System.Web/System.Web/BrowserCapabilities.cs
  5. 1 4
      mcs/class/System.Web/System.Web/CapabilitiesLoader.cs
  6. 5 8
      mcs/class/System.Web/System.Web/DefaultHttpHandler.cs
  7. 13 92
      mcs/class/System.Web/System.Web/HttpApplication.cs
  8. 10 48
      mcs/class/System.Web/System.Web/HttpApplicationFactory.cs
  9. 2 2
      mcs/class/System.Web/System.Web/HttpApplicationState.cs
  10. 1 3
      mcs/class/System.Web/System.Web/HttpBrowserCapabilities.cs
  11. 1 14
      mcs/class/System.Web/System.Web/HttpCachePolicy.cs
  12. 4 5
      mcs/class/System.Web/System.Web/HttpCacheRevalidation.cs
  13. 1 3
      mcs/class/System.Web/System.Web/HttpCacheVaryByContentEncodings.cs
  14. 5 10
      mcs/class/System.Web/System.Web/HttpCacheVaryByHeaders.cs
  15. 5 9
      mcs/class/System.Web/System.Web/HttpCacheVaryByParams.cs
  16. 4 5
      mcs/class/System.Web/System.Web/HttpCacheability.cs
  17. 5 12
      mcs/class/System.Web/System.Web/HttpClientCertificate.cs
  18. 6 13
      mcs/class/System.Web/System.Web/HttpCompileException.cs
  19. 9 55
      mcs/class/System.Web/System.Web/HttpContext.cs
  20. 4 8
      mcs/class/System.Web/System.Web/HttpCookie.cs
  21. 10 22
      mcs/class/System.Web/System.Web/HttpCookieCollection.cs
  22. 1 5
      mcs/class/System.Web/System.Web/HttpCookieMode.cs
  23. 2 15
      mcs/class/System.Web/System.Web/HttpException.cs
  24. 5 14
      mcs/class/System.Web/System.Web/HttpParseException.cs
  25. 12 62
      mcs/class/System.Web/System.Web/HttpRequest.cs
  26. 7 16
      mcs/class/System.Web/System.Web/HttpRequestValidationException.cs
  27. 15 51
      mcs/class/System.Web/System.Web/HttpResponse.cs
  28. 7 9
      mcs/class/System.Web/System.Web/HttpResponseHeader.cs
  29. 5 15
      mcs/class/System.Web/System.Web/HttpResponseStream.cs
  30. 3 7
      mcs/class/System.Web/System.Web/HttpResponseSubstitutionCallback.cs
  31. 10 37
      mcs/class/System.Web/System.Web/HttpRuntime.cs
  32. 12 26
      mcs/class/System.Web/System.Web/HttpServerUtility.cs
  33. 5 14
      mcs/class/System.Web/System.Web/HttpStaticObjectsCollection.cs
  34. 5 14
      mcs/class/System.Web/System.Web/HttpUnhandledException.cs
  35. 25 43
      mcs/class/System.Web/System.Web/HttpUtility.cs
  36. 4 5
      mcs/class/System.Web/System.Web/HttpValidationStatus.cs
  37. 14 46
      mcs/class/System.Web/System.Web/HttpWorkerRequest.cs
  38. 5 4
      mcs/class/System.Web/System.Web/HttpWriter.cs
  39. 0 2
      mcs/class/System.Web/System.Web/IPartitionResolver.cs
  40. 1 2
      mcs/class/System.Web/System.Web/IisTraceListener.cs
  41. 4 20
      mcs/class/System.Web/System.Web/MimeTypes.cs
  42. 3 7
      mcs/class/System.Web/System.Web/NoParamsInvoker.cs
  43. 5 4
      mcs/class/System.Web/System.Web/OutputFilterStream.cs
  44. 3 5
      mcs/class/System.Web/System.Web/ParserError.cs
  45. 3 6
      mcs/class/System.Web/System.Web/ParserErrorCollection.cs
  46. 4 5
      mcs/class/System.Web/System.Web/ProcessShutdownReason.cs
  47. 2 8
      mcs/class/System.Web/System.Web/QueueManager.cs
  48. 1 3
      mcs/class/System.Web/System.Web/RequestNotification.cs
  49. 1 3
      mcs/class/System.Web/System.Web/RequestNotificationStatus.cs
  50. 5 5
      mcs/class/System.Web/System.Web/SiteMap.cs
  51. 1 2
      mcs/class/System.Web/System.Web/SiteMapNode.cs
  52. 2 3
      mcs/class/System.Web/System.Web/SiteMapNodeCollection.cs
  53. 6 5
      mcs/class/System.Web/System.Web/SiteMapProvider.cs
  54. 2 3
      mcs/class/System.Web/System.Web/SiteMapProviderCollection.cs
  55. 1 3
      mcs/class/System.Web/System.Web/SiteMapResolveEventArgs.cs
  56. 1 2
      mcs/class/System.Web/System.Web/StaticFileHandler.cs
  57. 1 3
      mcs/class/System.Web/System.Web/StaticSiteMapProvider.cs
  58. 6 18
      mcs/class/System.Web/System.Web/TraceContext.cs
  59. 1 5
      mcs/class/System.Web/System.Web/TraceContextEventArgs.cs
  60. 3 7
      mcs/class/System.Web/System.Web/TraceContextEventHandler.cs
  61. 0 2
      mcs/class/System.Web/System.Web/TraceContextRecord.cs
  62. 10 91
      mcs/class/System.Web/System.Web/TraceData.cs
  63. 5 15
      mcs/class/System.Web/System.Web/TraceManager.cs
  64. 3 3
      mcs/class/System.Web/System.Web/VirtualPath.cs
  65. 2 8
      mcs/class/System.Web/System.Web/VirtualPathUtility.cs
  66. 0 2
      mcs/class/System.Web/System.Web/WebPageTraceListener.cs
  67. 2 3
      mcs/class/System.Web/System.Web/WebROCollection.cs
  68. 0 2
      mcs/class/System.Web/System.Web/XmlSiteMapProvider.cs

+ 1 - 13
mcs/class/System.Web/Assembly/AssemblyInfo.cs

@@ -5,6 +5,7 @@
 //   Andreas Nahr ([email protected])
 //
 // (C) 2003 Ximian, Inc.  http://www.ximian.com
+// (C) 2003-2009 Novell, Inc (http://novell.com)
 //
 
 //
@@ -64,21 +65,15 @@ using System.Web.UI;
 [assembly: AssemblyDelaySign(true)]
 [assembly: AssemblyKeyFile("../msfinal.pub")]
 
-#if NET_2_0
 [assembly: InternalsVisibleTo ("System.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
 [assembly: InternalsVisibleTo ("System.Web.DynamicData, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
 
-#endif
 #endif
 
-#if NET_2_0
 [assembly: InternalsVisibleTo ("SystemWebTestShim, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
-#endif
 
 // Resources
 
-#if NET_2_0
-
 [assembly: WebResource ("TreeView_noexpand.gif", "image/gif")]
 [assembly: WebResource ("TreeView_dash.gif", "image/gif")]
 [assembly: WebResource ("TreeView_dashminus.gif", "image/gif")]
@@ -117,15 +112,8 @@ using System.Web.UI;
 [assembly: WebResource ("file.gif", "image/gif")]
 [assembly: WebResource ("folder.gif", "image/gif")]
 [assembly: WebResource ("computer.gif", "image/gif")]
-
 [assembly: WebResource ("TreeView.js", "text/javascript")]
 [assembly: WebResource ("Menu.js", "text/javascript")]
 [assembly: WebResource ("GridView.js", "text/javascript")]
 [assembly: WebResource ("webform.js", "text/javascript")]
-#endif
-
-#if NET_2_0
 [assembly: WebResource ("WebUIValidation_2.0.js", "text/javascript")]
-#else
-[assembly: WebResource ("WebUIValidation.js", "text/javascript")]
-#endif

+ 5 - 6
mcs/class/System.Web/System.Web/ApplicationShutdownReason.cs

@@ -4,6 +4,8 @@
 // Authors:
 //	Duncan Mak ([email protected])
 //
+// Copyright (C) 2004-2009 Novell, Inc (http://www.novell.com)
+//
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // "Software"), to deal in the Software without restriction, including
@@ -23,10 +25,8 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
 //
 
-#if NET_2_0
 namespace System.Web
 {
         public enum ApplicationShutdownReason
@@ -46,11 +46,10 @@ namespace System.Web
                 HttpRuntimeClose = 12,
                 InitializationError = 13,
                 MaxRecompilationsReached = 14
-
-		#if NET_3_5
+#if NET_3_5
 		, BuildManagerChange = 15
-		#endif 		
+#endif 		
         }
 }
-#endif
+
 

+ 0 - 2
mcs/class/System.Web/System.Web/BaseParamsCollection.cs

@@ -143,11 +143,9 @@ namespace System.Web
 			}
 		}
 
-#if NET_2_0
 		public override System.Collections.IEnumerator GetEnumerator () {
 			LoadInfo ();
 			return base.GetEnumerator ();
 		}
-#endif
 	}
 }

+ 7 - 28
mcs/class/System.Web/System.Web/BrowserCapabilities.cs

@@ -5,7 +5,7 @@
 //   Patrik Torstensson ([email protected])
 //   Gonzalo Paniagua Javier ([email protected])
 //
-// (c) 2003 Novell, Inc. (http://www.novell.com)
+// (c) 2003-2009 Novell, Inc. (http://www.novell.com)
 //
 
 //
@@ -36,16 +36,9 @@ using System.Web.UI;
 using System.Security.Permissions;
 using System.Web.Util;
 
-#if NET_2_0
-namespace System.Web.Configuration {
+namespace System.Web.Configuration
+{
 	public partial class HttpCapabilitiesBase
-#else
-
-namespace System.Web {
-	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public class HttpBrowserCapabilities : HttpCapabilitiesBase
-#endif
 	{
 		const int HaveActiveXControls = 1; // 1;
 		const int HaveAdapters = 2;
@@ -189,12 +182,6 @@ namespace System.Web {
 		Version [] clrVersions;
 		internal string useragent;
 
-#if !NET_2_0
-		public HttpBrowserCapabilities ()
-		{
-		}
-#endif
-
 		public bool ActiveXControls {
 			get {
 				if (!Get (HaveActiveXControls)) {
@@ -251,7 +238,7 @@ namespace System.Web {
 				return browser;
 			}
 		}
-#if NET_2_0
+
 		ArrayList browsers = null;
 		public ArrayList Browsers {
 			get {
@@ -276,7 +263,7 @@ namespace System.Web {
 			}
 			return false;
 		}
-#endif
+
 		public bool CDF {
 			get {
 				if (!Get (HaveCDF)) {
@@ -352,9 +339,8 @@ namespace System.Web {
 			}
 		}
 
-#if NET_2_0
+
 		[Obsolete]
-#endif
 		public bool JavaScript {
 			get {
 				if (!Get (HaveJavaScript)) {
@@ -499,7 +485,6 @@ namespace System.Web {
 			}
 		}
 
-#if NET_1_1
 		public Version [] GetClrVersions ()
 		{
 			if (clrVersions == null)
@@ -507,7 +492,6 @@ namespace System.Web {
 
 			return clrVersions;
 		}
-#endif
 
 		void InternalGetClrVersions ()
 		{
@@ -537,11 +521,7 @@ namespace System.Web {
 			
 			if (list == null || list.Count == 0) {
 				clrVersion = new Version ();
-#if NET_2_0
 				clrVersions = null;
-#else
-				clrVersions = new Version [1] { clrVersion };
-#endif
 			} else {
 				list.Sort ();
 				clrVersions = (Version []) list.ToArray (typeof (Version));
@@ -611,7 +591,6 @@ namespace System.Web {
 			}
 		}
 
-#if NET_2_0
 		ArrayList ReadArrayList (string key) 
 		{
 			ArrayList v = (ArrayList)this.capabilities [key];
@@ -621,7 +600,7 @@ namespace System.Web {
 
 			return v;
 		}
-#endif
+
 		Exception CreateCapabilityNotFoundException (string key) {
 			return new ArgumentNullException (String.Format ("browscaps.ini does not contain a definition for capability {0} for userAgent {1}", key, Browser));
 		}

+ 1 - 4
mcs/class/System.Web/System.Web/CapabilitiesLoader.cs

@@ -8,7 +8,7 @@
 // Authors:
 //   Gonzalo Paniagua Javier ([email protected])
 //
-// (c) 2003 Novell, Inc. (http://www.novell.com)
+// (c) 2003-2009 Novell, Inc. (http://www.novell.com)
 //
 
 //
@@ -257,8 +257,6 @@ namespace System.Web
 			defaultCaps.Add ("win16", "False");
 			defaultCaps.Add ("win32", "False");
 			defaultCaps.Add ("win64", "False");
-
-#if NET_2_0
 			defaultCaps.Add ("adapters", new Hashtable ());
 			defaultCaps.Add ("cancombineformsindeck", "False");
 			defaultCaps.Add ("caninitiatevoicecall", "False");
@@ -341,7 +339,6 @@ namespace System.Web
 			defaultCaps.Add ("supportsuncheck", "True");
 			defaultCaps.Add ("supportsxmlhttp", "False");
 			defaultCaps.Add ("type", "Unknown");
-#endif
 		}
 		
 		public static Hashtable GetCapabilities (string userAgent)

+ 5 - 8
mcs/class/System.Web/System.Web/DefaultHttpHandler.cs

@@ -4,9 +4,8 @@
 // Author:
 //	Gonzalo Paniagua Javier ([email protected])
 //
-
 //
-// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2006-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -28,13 +27,12 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System.Collections.Specialized;
 
-namespace System.Web {
-	public class DefaultHttpHandler : IHttpAsyncHandler {
-
+namespace System.Web
+{
+	public class DefaultHttpHandler : IHttpAsyncHandler
+	{
 		protected HttpContext Context {
 			get { return null; }
 		}
@@ -74,5 +72,4 @@ namespace System.Web {
 		}
 	}
 }
-#endif
 

+ 13 - 92
mcs/class/System.Web/System.Web/HttpApplication.cs

@@ -6,7 +6,7 @@
 //	Gonzalo Paniagua ([email protected])
 //    
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -82,8 +82,8 @@ using System.Web.Util;
 using Mainsoft.Web;
 #endif
 	
-namespace System.Web {
-
+namespace System.Web
+{
 	// CAS
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
@@ -159,7 +159,6 @@ namespace System.Web {
 
 		static string binDirectory;
 		
-#if NET_2_0
 #if TARGET_J2EE
 		const string initialization_exception_key = "System.Web.HttpApplication.initialization_exception";
 		static Exception initialization_exception {
@@ -170,7 +169,6 @@ namespace System.Web {
 		static Exception initialization_exception;
 #endif
 		bool removeConfigurationFromCache;
-#endif
 		bool fullInitComplete = false;
 		
 		//
@@ -202,17 +200,10 @@ namespace System.Web {
 				if (modcoll != null)
 					return;
 				
-#if NET_2_0
 				HttpModulesSection modules;
 				modules = (HttpModulesSection) WebConfigurationManager.GetWebApplicationSection ("system.web/httpModules");
-#else
-				ModulesConfiguration modules;
-
-				modules = (ModulesConfiguration) HttpContext.GetAppConfig ("system.web/httpModules");
-#endif
-
 				HttpContext saved = HttpContext.Current;
-				HttpContext.Current = new HttpContext (new System.Web.Hosting.SimpleWorkerRequest ("", "", new StringWriter()));
+				HttpContext.Current = new HttpContext (new System.Web.Hosting.SimpleWorkerRequest (String.Empty, String.Empty, new StringWriter()));
 				modcoll = modules.LoadModules (this);
 				HttpContext.Current = saved;
 
@@ -237,11 +228,9 @@ namespace System.Web {
 			}
 		}
 
-#if NET_2_0
 		internal static Exception InitializationException {
 			get { return initialization_exception; }
 		}
-#endif
 
 		[Browsable (false)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
@@ -346,18 +335,10 @@ namespace System.Web {
 
 		[Browsable (false)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-#if NET_2_0
 		public ISite Site {
-#else
-		public virtual ISite Site {
-#endif
-			get {
-				return isite;
-			}
+			get { return isite; }
 
-			set {
-				isite = value;
-			}
+			set { isite = value; }
 		}
 
 		[Browsable (false)]
@@ -549,7 +530,6 @@ namespace System.Web {
 			UpdateRequestCache += new EventHandler (invoker.Invoke);
 		}
 
-#if NET_2_0
 		static object PostAuthenticateRequestEvent = new object ();
 		public event EventHandler PostAuthenticateRequest
 		{
@@ -795,8 +775,6 @@ namespace System.Web {
 			AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, state);
 			PostLogRequest += new EventHandler (invoker.Invoke);
 		}
-
-#endif
 		
 		internal event EventHandler DefaultAuthentication;
 
@@ -889,14 +867,13 @@ namespace System.Web {
 				}
 			}
 			stop_processing = true;
-#if NET_2_0
+
 			// we want to remove configuration from the cache in case of 
 			// invalid resource not exists to prevent DOS attack.
 			HttpException httpEx = e as HttpException;
 			if (httpEx != null && httpEx.GetHttpCode () == 404) {
 				removeConfigurationFromCache = true;
 			}
-#endif
 		}
 		
 		//
@@ -1110,9 +1087,8 @@ namespace System.Web {
 					context.Handler = null;
 					factory = null;
 				}
-#if NET_2_0
 				context.PopHandler ();
-#endif
+
 				// context = null; -> moved to PostDone
 				pipeline = null;
 				current_ai = null;
@@ -1178,9 +1154,7 @@ namespace System.Web {
 			if (stop_processing)
 				yield return true;
 
-#if NET_2_0
 			context.MapRequestHandlerDone = false;
-#endif
 			StartTimer ("BeginRequest");
 			eventHandler = Events [BeginRequestEvent];
 			if (eventHandler != null) {
@@ -1202,28 +1176,26 @@ namespace System.Web {
 					yield return stop;
 			StopTimer ();
 
-#if NET_2_0
 			StartTimer ("PostAuthenticateRequest");
 			eventHandler = Events [PostAuthenticateRequestEvent];
 			if (eventHandler != null)
 				foreach (bool stop in RunHooks (eventHandler))
 					yield return stop;
 			StopTimer ();
-#endif
+
 			StartTimer ("AuthorizeRequest");
 			eventHandler = Events [AuthorizeRequestEvent];
 			if (eventHandler != null)
 				foreach (bool stop in RunHooks (eventHandler))
 					yield return stop;
 			StopTimer ();
-#if NET_2_0
+
 			StartTimer ("PostAuthorizeRequest");
 			eventHandler = Events [PostAuthorizeRequestEvent];
 			if (eventHandler != null)
 				foreach (bool stop in RunHooks (eventHandler))
 					yield return stop;
 			StopTimer ();
-#endif
 
 			StartTimer ("ResolveRequestCache");
 			eventHandler = Events [ResolveRequestCacheEvent];
@@ -1232,7 +1204,6 @@ namespace System.Web {
 					yield return stop;
 			StopTimer ();
 
-#if NET_2_0
 			StartTimer ("PostResolveRequestCache");
 			eventHandler = Events [PostResolveRequestCacheEvent];
 			if (eventHandler != null)
@@ -1248,7 +1219,6 @@ namespace System.Web {
 					yield return stop;
 			StopTimer ();
 			context.MapRequestHandlerDone = true;
-#endif
 			
 			StartTimer ("GetHandler");
 			// Obtain the handler for the request.
@@ -1256,9 +1226,7 @@ namespace System.Web {
 			try {
 				handler = GetHandler (context, context.Request.CurrentExecutionFilePath);
 				context.Handler = handler;
-#if NET_2_0
 				context.PushHandler (handler);
-#endif
 			} catch (FileNotFoundException fnf){
 #if TARGET_JVM
 				Console.WriteLine ("$$$$$$$$$$:Sys.Web Pipeline");
@@ -1280,14 +1248,12 @@ namespace System.Web {
 			if (stop_processing)
 				yield return true;
 
-#if NET_2_0
 			StartTimer ("PostMapRequestHandler");
 			eventHandler = Events [PostMapRequestHandlerEvent];
 			if (eventHandler != null)
 				foreach (bool stop in RunHooks (eventHandler))
 					yield return stop;
 			StopTimer ();
-#endif
 
 			StartTimer ("AcquireRequestState");
 			eventHandler = Events [AcquireRequestStateEvent];
@@ -1297,7 +1263,6 @@ namespace System.Web {
 			}
 			StopTimer ();
 			
-#if NET_2_0
 			StartTimer ("PostAcquireRequestState");
 			eventHandler = Events [PostAcquireRequestStateEvent];
 			if (eventHandler != null){
@@ -1305,7 +1270,6 @@ namespace System.Web {
 					yield return stop;
 			}
 			StopTimer ();
-#endif
 			
 			//
 			// From this point on, we need to ensure that we call
@@ -1326,14 +1290,12 @@ namespace System.Web {
 			bool doProcessHandler = false;
 #endif
 			
-#if NET_2_0
 			IHttpHandler ctxHandler = context.Handler;
 			if (ctxHandler != null && handler != ctxHandler) {
 				context.PopHandler ();
 				handler = ctxHandler;
 				context.PushHandler (handler);
 			}
-#endif
 
 			StartTimer ("ProcessRequest");
 			try {
@@ -1400,14 +1362,12 @@ namespace System.Web {
 			if (stop_processing)
 				yield return true;
 
-#if NET_2_0
 			StartTimer ("PostReleaseRequestState");
 			eventHandler = Events [PostReleaseRequestStateEvent];
 			if (eventHandler != null)
 				foreach (bool stop in RunHooks (eventHandler))
 					yield return stop;
 			StopTimer ();
-#endif
 
 			StartTimer ("Filter");
 			if (context.Error == null)
@@ -1421,7 +1381,6 @@ namespace System.Web {
 					yield return stop;
 			StopTimer ();
 
-#if NET_2_0
 			StartTimer ("PostUpdateRequestCache");
 			eventHandler = Events [PostUpdateRequestCacheEvent];
 			if (eventHandler != null)
@@ -1442,7 +1401,7 @@ namespace System.Web {
 				foreach (bool stop in RunHooks (eventHandler))
 					yield return stop;
 			StopTimer ();
-#endif
+
 			StartTimer ("PipelineDone");
 			PipelineDone ();
 			StopTimer ();
@@ -1451,7 +1410,6 @@ namespace System.Web {
 
 		internal CultureInfo GetThreadCulture (HttpRequest request, CultureInfo culture, bool isAuto)
 		{
-#if NET_2_0
 			if (!isAuto)
 				return culture;
 			CultureInfo ret = null;
@@ -1466,32 +1424,17 @@ namespace System.Web {
 				ret = culture;
 			
 			return ret;
-#else
-			return culture;
-#endif
 		}
 
 
 		void PreStart ()
 		{
-#if NET_2_0
 			GlobalizationSection cfg;
 			cfg = (GlobalizationSection) WebConfigurationManager.GetSection ("system.web/globalization");
 			app_culture = cfg.GetCulture ();
 			autoCulture = cfg.IsAutoCulture;
 			appui_culture = cfg.GetUICulture ();
 			autoUICulture = cfg.IsAutoUICulture;
-#else
-			GlobalizationConfiguration cfg;
-			cfg = GlobalizationConfiguration.GetInstance (null);
-			if (cfg != null) {
-				app_culture = cfg.Culture;
-				autoCulture = false; // to hush the warning
-				appui_culture = cfg.UICulture;
-				autoUICulture = false; // to hush the warning
-			}
-#endif
-
 #if !TARGET_J2EE
 			context.StartTimeoutTimer ();
 #endif
@@ -1517,12 +1460,11 @@ namespace System.Web {
 
 		void PostDone ()
 		{
-#if NET_2_0
 			if (removeConfigurationFromCache) {
 				WebConfigurationManager.RemoveConfigurationFromCache (context);
 				removeConfigurationFromCache = false;
 			}
-#endif
+
 			Thread th = Thread.CurrentThread;
 #if !TARGET_JVM
 			if (Thread.CurrentPrincipal != prev_user)
@@ -1557,9 +1499,7 @@ namespace System.Web {
 			try {
 				InitOnce (true);
 			} catch (Exception e) {
-#if NET_2_0
 				initialization_exception = e;
-#endif
 				FinalErrorWrite (context.Response, new HttpException ("", e).GetHtmlErrorMessage ());
 				PipelineDone ();
 				return;
@@ -1602,13 +1542,8 @@ namespace System.Web {
 				return ret;
 
 			bool allowCache;
-#if NET_2_0
 			HttpHandlersSection httpHandlersSection = WebConfigurationManager.GetSection ("system.web/httpHandlers", req.Path, req.Context) as HttpHandlersSection;
 			ret = httpHandlersSection.LocateHandler (verb, url, out allowCache);
-#else
-			HandlerFactoryConfiguration factory_config = (HandlerFactoryConfiguration) HttpContext.GetAppConfig ("system.web/httpHandlers");
-			ret = factory_config.LocateHandler (verb, url, out allowCache);
-#endif
 
 			IHttpHandler handler = ret as IHttpHandler;
 			if (allowCache && handler != null && handler.IsReusable)
@@ -1734,15 +1669,7 @@ namespace System.Web {
 			if (!context.IsCustomErrorEnabledUnsafe)
 				return false;
 			
-#if NET_2_0
-			CustomErrorsSection config = (CustomErrorsSection)WebConfigurationManager.GetSection ("system.web/customErrors");
-#else
-			CustomErrorsConfig config = null;
-			try {
-				config = (CustomErrorsConfig) context.GetConfig ("system.web/customErrors");
-			} catch { }
-#endif
-			
+			CustomErrorsSection config = (CustomErrorsSection)WebConfigurationManager.GetSection ("system.web/customErrors");			
 			if (config == null) {
 				if (context.ErrorPage != null)
 					return RedirectErrorPage (context.ErrorPage);
@@ -1750,12 +1677,8 @@ namespace System.Web {
 				return false;
 			}
 			
-#if NET_2_0
 			CustomError err = config.Errors [context.Response.StatusCode.ToString()];
 			string redirect = err == null ? null : err.Redirect;
-#else
-			string redirect =  config [context.Response.StatusCode];
-#endif
 			if (redirect == null) {
 				redirect = context.ErrorPage;
 				if (redirect == null)
@@ -1833,7 +1756,6 @@ namespace System.Web {
 					return type;
 			}
 
-#if NET_2_0
 			IList tla = System.Web.Compilation.BuildManager.TopLevelAssemblies;
 			if (tla != null && tla.Count > 0) {
 				foreach (Assembly asm in tla) {
@@ -1844,7 +1766,6 @@ namespace System.Web {
 						return type;
 				}
 			}
-#endif
 
 			Exception loadException = null;
 			try {

+ 10 - 48
mcs/class/System.Web/System.Web/HttpApplicationFactory.cs

@@ -5,7 +5,7 @@
 //	Gonzalo Paniagua Javier ([email protected])
 //
 // (c) 2002,2003 Ximian, Inc. (http://www.ximian.com)
-// (c) Copyright 2004 Novell, Inc. (http://www.novell.com)
+// (c) Copyright 2004-2009 Novell, Inc. (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -40,14 +40,14 @@ using System.Web.Util;
 using System.Web.Compilation;
 #if TARGET_J2EE
 using vmw.common;
-#endif
-
-#if NET_2_0 && !TARGET_J2EE
+#else
 using System.CodeDom.Compiler;
 #endif
 
-namespace System.Web {
-	class HttpApplicationFactory {
+namespace System.Web
+{
+	sealed class HttpApplicationFactory
+	{
 		object this_lock = new object ();
 		
 		// Initialized in InitType
@@ -82,12 +82,10 @@ namespace System.Web {
 		static ArrayList watchers = new ArrayList();
 		static object watchers_lock = new object();
 		static bool app_shutdown = false;
-#if NET_2_0
 		static bool app_disabled = false;
 		static string[] app_browsers_files = new string[0];
 		static string[] default_machine_browsers_files = new string[0];
 		static string[] app_mono_machine_browsers_files = new string[0];
-#endif
 		Stack available = new Stack ();
 		object next_free;
 		Stack available_for_end = new Stack ();
@@ -317,12 +315,7 @@ namespace System.Web {
 				} else {
 					evt.AddEventHandler (target, Delegate.CreateDelegate (
 								     evt.EventHandlerType, app,
-#if NET_2_0
-								     method
-#else
-								     method.Name
-#endif
-							     ));
+								     method));
 				}
 			}
 			
@@ -401,9 +394,7 @@ namespace System.Web {
 				if (!needs_init)
 					return;
 
-#if NET_2_0
 				try {
-#endif
 					string physical_app_path = HttpRuntime.AppDomainAppPath;
 					string app_file = null;
 					
@@ -414,11 +405,7 @@ namespace System.Web {
 							app_file = null;
 					}
 			
-#if !NET_2_0
-					WebConfigurationSettings.Init (context);
-#endif
-		
-#if NET_2_0 && !TARGET_J2EE
+#if !TARGET_J2EE
 					AppResourcesCompiler ac = new AppResourcesCompiler (context);
 					ac.Compile ();
 
@@ -458,19 +445,13 @@ namespace System.Web {
 					}
 #endif
 
-#if NET_2_0
 					app_type = BuildManager.GetPrecompiledApplicationType ();
-#endif
 					if (app_type == null && app_file != null) {
 #if TARGET_J2EE
 						app_file = System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute("~/" + Path.GetFileName(app_file));
 						app_type = System.Web.J2EE.PageMapper.GetObjectType(context, app_file);
 #else
-#if NET_2_0
 						app_type = BuildManager.GetCompiledType ("~/" + Path.GetFileName (app_file));
-#else
-						app_type = ApplicationFileParser.GetCompiledApplicationType (app_file, context);
-#endif
 #endif
 						if (app_type == null) {
 							string msg = String.Format ("Error compiling application file ({0}).", app_file);
@@ -497,7 +478,6 @@ namespace System.Web {
 #endif
 					
 					needs_init = false;
-#if NET_2_0
 				} catch (Exception) {
 					if (BuildManager.CodeAssemblies != null)
 						BuildManager.CodeAssemblies.Clear ();
@@ -507,12 +487,6 @@ namespace System.Web {
 						WebConfigurationManager.ExtraAssemblies.Clear ();
 					throw;
 				}
-#endif
-				
-				//
-				// Now init the settings
-				//
-
 			}
 		}
 
@@ -542,8 +516,7 @@ namespace System.Web {
 					if (factory.app_start_needed) {
 						foreach (string dir in HttpApplication.BinDirs)
 							WatchLocationForRestart (dir, "*.dll");
-#if NET_2_0
-									// Restart if the App_* directories are created...
+						// Restart if the App_* directories are created...
 			                        WatchLocationForRestart (".", "App_Code");
 			                        WatchLocationForRestart (".", "App_Browsers");
 			                        WatchLocationForRestart (".", "App_GlobalResources");
@@ -551,7 +524,6 @@ namespace System.Web {
 			                        WatchLocationForRestart ("App_Code", "*", true);
 			                        WatchLocationForRestart ("App_Browsers", "*");
 			                        WatchLocationForRestart ("App_GlobalResources", "*");
-#endif
 			                        app = factory.FireOnAppStart (context);
 						factory.app_start_needed = false;
 						return app;
@@ -660,7 +632,6 @@ namespace System.Web {
 			}
 	        }
 
-#if NET_2_0
 		internal static bool ApplicationDisabled {
 			get { return app_disabled; }
 			set { app_disabled = value; }
@@ -692,7 +663,6 @@ namespace System.Web {
 				return capabilities_processor;
 			}
 		}
-#endif
 		
 		internal static void DisableWatchers ()
 		{
@@ -716,13 +686,7 @@ namespace System.Web {
 		{
 			lock (watchers_lock) {
 				foreach (FileSystemWatcher watcher in watchers) {
-					if (
-#if NET_2_0
-						String.Compare (watcher.Path, virtualPath, StringComparison.Ordinal) != 0 || String.Compare (watcher.Filter, filter, StringComparison.Ordinal) != 0
-#else
-						String.Compare (watcher.Path, virtualPath) != 0 || String.Compare (watcher.Filter, filter) != 0
-#endif
-					)
+					if (String.Compare (watcher.Path, virtualPath, StringComparison.Ordinal) != 0 || String.Compare (watcher.Filter, filter, StringComparison.Ordinal) != 0)
 						continue;
 					
 					watcher.EnableRaisingEvents = enable;
@@ -764,7 +728,6 @@ namespace System.Web {
 			if (watcher != null && String.Compare (watcher.Filter, "?eb.?onfig", true, Helpers.InvariantCulture) == 0 && Directory.Exists (name))
 				return;
 
-#if NET_2_0
 			// We re-enable suppression here since WebConfigurationManager will disable
 			// it after save is done. WebConfigurationManager is called twice by
 			// Configuration - just after opening the target file and just after closing
@@ -773,7 +736,6 @@ namespace System.Web {
 			// change notification.
 			if (isConfig && WebConfigurationManager.SuppressAppReload (true))
 				return;
-#endif
 			
 	        	lock (watchers_lock) {
 				if(app_shutdown)

+ 2 - 2
mcs/class/System.Web/System.Web/HttpApplicationState.cs

@@ -30,8 +30,8 @@ using System.Threading;
 using System.Collections.Specialized;
 using System.Security.Permissions;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public sealed class HttpApplicationState : NameObjectCollectionBase 

+ 1 - 3
mcs/class/System.Web/System.Web/HttpBrowserCapabilities.cs

@@ -5,7 +5,7 @@
 //   Patrik Torstensson ([email protected])
 //   Gonzalo Paniagua Javier ([email protected])
 //
-// Copyright (C) 2003,2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2003-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -27,7 +27,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Security.Permissions;
 using System.Web.Configuration;
 using System.Web.UI;
@@ -59,4 +58,3 @@ namespace System.Web
 	}
 }
 
-#endif

+ 1 - 14
mcs/class/System.Web/System.Web/HttpCachePolicy.cs

@@ -47,9 +47,7 @@ namespace System.Web
 		{
 		}
 
-#if NET_2_0
 		HttpCacheVaryByContentEncodings vary_by_content_encodings = new HttpCacheVaryByContentEncodings ();
-#endif
 		HttpCacheVaryByHeaders vary_by_headers = new HttpCacheVaryByHeaders ();
 		HttpCacheVaryByParams vary_by_params = new HttpCacheVaryByParams ();
 		ArrayList validation_callbacks;
@@ -82,13 +80,11 @@ namespace System.Web
 		bool set_no_store;
 		bool set_no_transform;
 		bool valid_until_expires;
-#if NET_2_0
 		bool omit_vary_star;
 		
 		public HttpCacheVaryByContentEncodings VaryByContentEncodings {
 			get { return vary_by_content_encodings; }
 		}
-#endif
 
 		public HttpCacheVaryByHeaders VaryByHeaders {
 			get { return vary_by_headers; }
@@ -119,15 +115,8 @@ namespace System.Web
 			get { return validation_callbacks; }
 		}
 
-		// always false in 1.x
 		internal bool OmitVaryStar {
-			get {
-#if NET_2_0
-				return omit_vary_star;
-#else
-				return false;
-#endif
-			}
+			get { return omit_vary_star; }
 		}
 
 		internal bool ValidUntilExpires {
@@ -422,11 +411,9 @@ namespace System.Web
 				etag = etagsb.ToString ();
 		}
 
-#if NET_2_0
 		public void SetOmitVaryStar (bool omit)
 		{
 			omit_vary_star = omit;
 		}
-#endif
 	}
 }

+ 4 - 5
mcs/class/System.Web/System.Web/HttpCacheRevalidation.cs

@@ -28,11 +28,10 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-namespace System.Web {
-#if !NET_2_0
-	[Serializable]
-#endif
-	public enum HttpCacheRevalidation {
+namespace System.Web
+{
+	public enum HttpCacheRevalidation
+	{
 		AllCaches = 0x1,
 		ProxyCaches,
 		None,

+ 1 - 3
mcs/class/System.Web/System.Web/HttpCacheVaryByContentEncodings.cs

@@ -4,7 +4,7 @@
 // Authors:
 //   Marek Habersack ([email protected])
 //
-// (C) 2007 Novell, Inc
+// (C) 2007-2009 Novell, Inc (http://novell.com)
 //
 
 //
@@ -27,7 +27,6 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
 using System;
 using System.Collections.Generic;
 using System.Security.Permissions;
@@ -64,4 +63,3 @@ namespace System.Web
 		}
 	}
 }
-#endif

+ 5 - 10
mcs/class/System.Web/System.Web/HttpCacheVaryByHeaders.cs

@@ -6,7 +6,7 @@
 //
 
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -31,12 +31,12 @@
 using System.Collections;
 using System.Security.Permissions;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public sealed class HttpCacheVaryByHeaders {
-
+	public sealed class HttpCacheVaryByHeaders
+	{
 		/* I would have much rather seen this class just use the
 		 * Hashtable, and have the getter/setters for the builtin
 		 * fields just manipulate that Hashtable, but that doesn't
@@ -69,12 +69,7 @@ namespace System.Web {
 		internal HttpCacheVaryByHeaders ()
 		{
 			/* the field names are meant to be case insensitive */
-#if NET_2_0
 			fields = new Hashtable (StringComparer.InvariantCultureIgnoreCase);
-#else
-			fields = new Hashtable(CaseInsensitiveHashCodeProvider.Default,
-					       CaseInsensitiveComparer.Default);
-#endif
 		}
 
 		internal string[] GetHeaderNames (bool omitVaryStar)

+ 5 - 9
mcs/class/System.Web/System.Web/HttpCacheVaryByParams.cs

@@ -6,7 +6,7 @@
 //
 
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -32,24 +32,20 @@ using System.Collections;
 using System.Security.Permissions;
 using System.Text;
 
-namespace System.Web {
+namespace System.Web
+{
 
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public sealed class HttpCacheVaryByParams {
-
+	public sealed class HttpCacheVaryByParams
+	{
 		bool ignore_parms;
 		Hashtable parms;
 
 		internal HttpCacheVaryByParams ()
 		{
 			/* the parameter names are meant to be case insensitive */
-#if NET_2_0
 			parms = new Hashtable (StringComparer.InvariantCultureIgnoreCase);
-#else
-			parms = new Hashtable(CaseInsensitiveHashCodeProvider.Default,
-					      CaseInsensitiveComparer.Default);
-#endif
 		}
 
 		internal string[] GetParamNames ()

+ 4 - 5
mcs/class/System.Web/System.Web/HttpCacheability.cs

@@ -28,11 +28,10 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-namespace System.Web {
-#if !NET_2_0
-	[Serializable]
-#endif
-	public enum HttpCacheability {
+namespace System.Web
+{
+	public enum HttpCacheability
+	{
 		NoCache = 0x1,
 		Private,
 		Server,

+ 5 - 12
mcs/class/System.Web/System.Web/HttpClientCertificate.cs

@@ -4,7 +4,7 @@
 // Author:
 //	Sebastien Pouliot  <[email protected]>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -31,29 +31,23 @@ using System.Globalization;
 using System.Security.Permissions;
 using System.Web.Util;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	// CAS
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public class HttpClientCertificate : NameValueCollection {
-
+	public class HttpClientCertificate : NameValueCollection
+	{
 		HttpWorkerRequest hwr;
 		int flags;
 		DateTime from;
 		DateTime until;
 
-
 		internal HttpClientCertificate (HttpWorkerRequest hwr)
 		{
-#if NET_2_0
 			// we don't check hwr for null so we end up throwing a 
 			// NullReferenceException just like MS implementation
 			// if the public ctor for HttpRequest is used
-#else
-			if (hwr == null)
-				throw new ArgumentNullException ("hwr");
-#endif
 			this.hwr = hwr;
 			flags = GetIntNoPresense ("CERT_FLAGS");
 			if (IsPresent) {
@@ -65,7 +59,6 @@ namespace System.Web {
 			}
 		}
 
-
 		public byte[] BinaryIssuer {
 			get { return hwr.GetClientCertificateBinaryIssuer (); }
 		}

+ 6 - 13
mcs/class/System.Web/System.Web/HttpCompileException.cs

@@ -6,7 +6,7 @@
 //	Sebastien Pouliot  <[email protected]>
 //
 // Copyright (C) Tim Coleman, 2002
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -32,19 +32,16 @@ using System.CodeDom.Compiler;
 using System.Runtime.Serialization;
 using System.Security.Permissions;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#if NET_2_0
 	[Serializable]
-#endif
-	public sealed class HttpCompileException : HttpException {
-
+	public sealed class HttpCompileException : HttpException
+	{
 		CompilerResults results;
 		string sourceCode;
 
-#if NET_2_0
 		public HttpCompileException ()
 		{
 		}
@@ -60,9 +57,6 @@ namespace System.Web {
 		}
 
 		public HttpCompileException (CompilerResults results, string sourceCode)
-#else
-		internal HttpCompileException (CompilerResults results, string sourceCode)
-#endif
 		{
 			this.results = results;
 			this.sourceCode = sourceCode;
@@ -78,7 +72,7 @@ namespace System.Web {
 			[AspNetHostingPermission (SecurityAction.Demand, Level = AspNetHostingPermissionLevel.High)]
 			get { return sourceCode; }
 		}
-#if NET_2_0
+
 		public override string Message {
 			get { return base.Message; }
 		}
@@ -90,6 +84,5 @@ namespace System.Web {
 			sourceCode = info.GetString ("sourcecode");
 			results = (CompilerResults) info.GetValue ("results", typeof (CompilerResults));
 		}
-#endif
 	}
 }

+ 9 - 55
mcs/class/System.Web/System.Web/HttpContext.cs

@@ -4,10 +4,11 @@
 // Author:
 //	Miguel de Icaza ([email protected])
 //	Gonzalo Paniagua Javier ([email protected])
+//      Marek Habersack <[email protected]>
 //
 
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -42,19 +43,19 @@ using System.Web.SessionState;
 using System.Web.UI;
 using System.Web.Util;
 using System.Reflection;
-#if NET_2_0
 using System.Collections.Generic;
 using System.IO;
 using System.Resources;
 using System.Web.Compilation;
 using System.Web.Profile;
 using CustomErrorMode = System.Web.Configuration.CustomErrorsMode;
-#endif
 
-namespace System.Web {
+namespace System.Web
+{
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public sealed partial class HttpContext : IServiceProvider {
+	public sealed partial class HttpContext : IServiceProvider
+	{
 		internal HttpWorkerRequest WorkerRequest;
 		HttpApplication app_instance;
 		HttpRequest request;
@@ -75,7 +76,6 @@ namespace System.Web {
 		Thread thread;
 		bool _isProcessingInclude;
 
-#if NET_2_0
 		[ThreadStatic]
 		static ResourceProviderFactory provider_factory;
 
@@ -104,7 +104,6 @@ namespace System.Web {
 				return default_provider_factory;
 			}
 		}
-#endif
 		
 		public HttpContext (HttpWorkerRequest wr)
 		{
@@ -215,19 +214,7 @@ namespace System.Web {
 
 		internal bool IsCustomErrorEnabledUnsafe {
 			get {
-#if NET_2_0
 				CustomErrorsSection cfg = (CustomErrorsSection) WebConfigurationManager.GetSection ("system.web/customErrors");
-#else
-				CustomErrorsConfig cfg = null;
-				try {
-					cfg = (CustomErrorsConfig) GetConfig ("system.web/customErrors");
-				} catch {
-				}
-
-				if (cfg == null)
-					return false;
-#endif
-
 				if (cfg.Mode == CustomErrorMode.On)
 					return true;
 
@@ -309,7 +296,6 @@ namespace System.Web {
 			}
 		}
 
-#if NET_2_0
 		internal bool MapRequestHandlerDone {
 			get;
 			set;
@@ -386,7 +372,6 @@ namespace System.Web {
 				profile = value;
 			}
 		}
-#endif
 
 		public void AddError (Exception errorInfo)
 		{
@@ -424,9 +409,7 @@ namespace System.Web {
 			errors = null;
 		}
 
-#if NET_2_0
 		[Obsolete ("use WebConfigurationManager.GetWebApplicationSection")]
-#endif
 		public static object GetAppConfig (string name)
 		{
 			object o = ConfigurationSettings.GetConfig (name);
@@ -434,19 +417,12 @@ namespace System.Web {
 			return o;
 		}
 
-#if NET_2_0
 		[Obsolete ("see GetSection")]
-#endif
 		public object GetConfig (string name)
 		{
-#if NET_2_0
 			return GetSection (name);
-#else
-			return WebConfigurationSettings.GetConfig (name, this);
-#endif
 		}
 
-#if NET_2_0
 		public static object GetGlobalResourceObject (string classKey, string resourceKey)
 		{
 			return GetGlobalResourceObject (classKey, resourceKey, Thread.CurrentThread.CurrentUICulture);
@@ -560,7 +536,7 @@ namespace System.Web {
 		{
 			return WebConfigurationManager.GetSection (name);
 		}
-#endif
+
 		object IServiceProvider.GetService (Type service)
 		{
 			if (service == typeof (HttpWorkerRequest))
@@ -606,22 +582,16 @@ namespace System.Web {
 			return null;
 		}
 
-#if NET_2_0
 		public void RemapHandler (IHttpHandler handler)
 		{
 			if (MapRequestHandlerDone)
 				throw new InvalidOperationException ("The RemapHandler method was called after the MapRequestHandler event occurred.");
 			Handler = handler;
 		}
-#endif
 		
 		public void RewritePath (string path)
 		{
-#if NET_2_0
 			RewritePath (path, true);
-#else
-			RewritePath (path, false);
-#endif
 		}
 
 		public void RewritePath (string filePath, string pathInfo, string queryString)
@@ -629,12 +599,7 @@ namespace System.Web {
 			RewritePath (filePath, pathInfo, queryString, false);
 		}
 
-#if NET_2_0
-		public
-#else
-		internal
-#endif
-		void RewritePath (string path, bool rebaseClientPath)
+		public void RewritePath (string path, bool rebaseClientPath)
 		{
 			int qmark = path.IndexOf ('?');
 			if (qmark != -1)
@@ -643,12 +608,7 @@ namespace System.Web {
 				RewritePath (path, null, null, rebaseClientPath);
 		}
 
-#if NET_2_0
-		public
-#else
-		internal
-#endif
-		void RewritePath (string filePath, string pathInfo, string queryString, bool setClientFilePath)
+		public void RewritePath (string filePath, string pathInfo, string queryString, bool setClientFilePath)
 		{
 			if (filePath == null)
 				throw new ArgumentNullException ("filePath");
@@ -708,14 +668,8 @@ namespace System.Web {
 		internal TimeSpan ConfigTimeout {
 			get {
 				if (config_timeout == null) {
-#if NET_2_0
 					HttpRuntimeSection section = (HttpRuntimeSection)WebConfigurationManager.GetSection ("system.web/httpRuntime");
 					config_timeout = section.ExecutionTimeout;
-#else
-					HttpRuntimeConfig config = (HttpRuntimeConfig)
-								GetConfig ("system.web/httpRuntime");
-					config_timeout = new TimeSpan (0, 0, config.ExecutionTimeout);
-#endif
 				}
 
 				return (TimeSpan) config_timeout;

+ 4 - 8
mcs/class/System.Web/System.Web/HttpCookie.cs

@@ -6,7 +6,7 @@
 //
 
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -32,8 +32,8 @@ using System.Text;
 using System.Collections.Specialized;
 using System.Security.Permissions;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	[Flags]
 	internal enum CookieFlags : byte {
 		Secure = 1,
@@ -206,7 +206,6 @@ namespace System.Web {
 			}
 		}
 
-#if NET_2_0
 		public bool HttpOnly {
 			get {
 				return (flags & CookieFlags.HttpOnly) == CookieFlags.HttpOnly;
@@ -219,21 +218,18 @@ namespace System.Web {
 					flags &= ~CookieFlags.HttpOnly;
 			}
 		}
-#endif
 
 		/*
 		 * simple utility class that just overrides ToString
 		 * to get the desired behavior for
 		 * HttpCookie.Values
 		 */
-		class CookieNVC : NameValueCollection
+		sealed class CookieNVC : NameValueCollection
 		{
-#if NET_2_0
 			public CookieNVC ()
 				: base (StringComparer.OrdinalIgnoreCase)
 			{
 			}
-#endif
 
 			public override string ToString ()
 			{

+ 10 - 22
mcs/class/System.Web/System.Web/HttpCookieCollection.cs

@@ -6,7 +6,7 @@
 //
 
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -32,39 +32,30 @@ using System.Collections;
 using System.Collections.Specialized;
 using System.Security.Permissions;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public sealed class HttpCookieCollection : NameObjectCollectionBase {
-
+	public sealed class HttpCookieCollection : NameObjectCollectionBase
+	{
 		private bool auto_fill = false;
 
 		[Obsolete ("Don't use this constructor, use the (bool, bool) one, as it's more clear what it does")]
-		internal HttpCookieCollection (HttpResponse Response, bool ReadOnly)
-#if NET_2_0
-			: base (StringComparer.OrdinalIgnoreCase)
-#endif
+		internal HttpCookieCollection (HttpResponse Response, bool ReadOnly) : base (StringComparer.OrdinalIgnoreCase)
 		{
 			auto_fill = Response != null;
 			IsReadOnly = ReadOnly;
 		}
 
-		internal HttpCookieCollection (bool auto_fill, bool read_only)
-#if NET_2_0
-			: base (StringComparer.OrdinalIgnoreCase)
-#endif
+		internal HttpCookieCollection (bool auto_fill, bool read_only) : base (StringComparer.OrdinalIgnoreCase)
 		{
 			this.auto_fill = auto_fill;
 			IsReadOnly = read_only;
 		}
 
-		internal HttpCookieCollection (string cookies)
-#if NET_2_0
-			: base (StringComparer.OrdinalIgnoreCase)
-#endif
+		internal HttpCookieCollection (string cookies) : base (StringComparer.OrdinalIgnoreCase)
 		{
-			if (cookies == null || cookies == "")
+			if (String.IsNullOrEmpty (cookies))
 				return;
 
 			string[] cookie_components = cookies.Split (';');
@@ -83,10 +74,7 @@ namespace System.Web {
 			}
 		}
 
-		public HttpCookieCollection ()
-#if NET_2_0
-			: base (StringComparer.OrdinalIgnoreCase)
-#endif
+		public HttpCookieCollection () : base (StringComparer.OrdinalIgnoreCase)
 		{
 		}
 

+ 1 - 5
mcs/class/System.Web/System.Web/HttpCookieMode.cs

@@ -26,12 +26,8 @@
 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
 //
 
-#if NET_2_0
 namespace System.Web
 {
-#if !NET_2_0
-        [Serializable]
-#endif
         public enum HttpCookieMode
         {
                 UseUri = 0,
@@ -40,4 +36,4 @@ namespace System.Web
                 UseDeviceProfile = 3,
         }
 }
-#endif
+

+ 2 - 15
mcs/class/System.Web/System.Web/HttpException.cs

@@ -7,7 +7,7 @@
 //
 // (c) 2002 Patrik Torstensson
 // (c) 2003 Ximian, Inc. (http://www.ximian.com)
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -43,9 +43,7 @@ namespace System.Web
 	// CAS
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#if NET_2_0
 	[Serializable]
-#endif
 	public class HttpException : ExternalException
 	{
 		const string DEFAULT_DESCRIPTION_TEXT = "Error processing request.";
@@ -86,25 +84,18 @@ namespace System.Web
 			this.description = description;
 		}
 		
-#if NET_2_0
-		protected
-#else
-		internal
-#endif
-		HttpException (SerializationInfo info, StreamingContext context)
+		protected HttpException (SerializationInfo info, StreamingContext context)
 			: base (info, context)
 		{
 			http_code = info.GetInt32 ("_httpCode");
 		}
 
-#if NET_2_0
 		[SecurityPermission (SecurityAction.Demand, SerializationFormatter = true)]
 		public override void GetObjectData (SerializationInfo info, StreamingContext context)
 		{
 			base.GetObjectData (info, context);
 			info.AddValue ("_httpCode", http_code);
 		}
-#endif
 
 		public HttpException (int httpCode, string message, int hr) 
 			: base (message, hr)
@@ -378,11 +369,7 @@ table.sampleCode {{width: 100%; background-color: #ffffcc; }}
 				builder.Append ("Compiler ");
 			
 			builder.Append ("Error Message: </strong>");
-#if NET_2_0
 			builder.AppendFormat ("<code>{0}</code></p>", errorMessage);
-#else
-			builder.AppendFormat ("<blockquote><pre>{0}</pre></blockquote></p>", errorMessage);
-#endif
 
 			StringBuilder longCodeVersion = null;
 			

+ 5 - 14
mcs/class/System.Web/System.Web/HttpParseException.cs

@@ -5,7 +5,7 @@
 //   Tim Coleman ([email protected])
 //
 // Copyright (C) Tim Coleman, 2002
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -30,21 +30,16 @@
 using System.Runtime.Serialization;
 using System.Security.Permissions;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#if NET_2_0
 	[Serializable]
-#endif
-	public sealed class HttpParseException : HttpException {
-
+	public sealed class HttpParseException : HttpException
+	{
 		int line;
 		string virtualPath;
-		
-#if NET_2_0
 		ParserErrorCollection errors = new ParserErrorCollection ();
-#endif
 
 		internal HttpParseException (string message, string virtualPath, int line)
 			: base (message)
@@ -53,7 +48,6 @@ namespace System.Web {
 			this.line = line;
 		}
 		
-#if NET_2_0
 		HttpParseException (SerializationInfo info, StreamingContext context)
 			: base (info, context)
                 {
@@ -94,7 +88,6 @@ namespace System.Web {
 			info.AddValue ("_parserErrors", errors);
 			info.AddValue ("_line", line);
 		}
-#endif
 
 		public string FileName {
 			get { return virtualPath; }
@@ -104,7 +97,6 @@ namespace System.Web {
 			get { return line; }
 		}
 		
-#if NET_2_0
 		public string VirtualPath {
 			get { return virtualPath; }
 		}
@@ -112,7 +104,6 @@ namespace System.Web {
 		public ParserErrorCollection ParserErrors {
 			get { return errors; }
 		}
-#endif
 	}
 }
 

+ 12 - 62
mcs/class/System.Web/System.Web/HttpRequest.cs

@@ -8,7 +8,7 @@
 //
 
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -42,11 +42,12 @@ using System.Web.UI;
 using System.Web.Util;
 using System.Globalization;
 
-namespace System.Web {
-	
+namespace System.Web
+{	
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public sealed partial class HttpRequest {
+	public sealed partial class HttpRequest
+	{
 		HttpWorkerRequest worker_request;
 		HttpContext context;
 		WebROCollection query_string_nvc;
@@ -95,16 +96,11 @@ namespace System.Web {
 		// Validations
 		bool validate_cookies, validate_query_string, validate_form;
 		bool checked_cookies, checked_query_string, checked_form;
-
-#if NET_2_0
 		static readonly UrlMappingCollection urlMappings;
-#endif
-		
 		readonly static char [] queryTrimChars = {'?'};
 		
 		static HttpRequest ()
 		{
-#if NET_2_0
 			try {
 				UrlMappingsSection ums = WebConfigurationManager.GetWebApplicationSection ("system.web/urlMappings") as UrlMappingsSection;
 				if (ums != null && ums.IsEnabled) {
@@ -115,7 +111,6 @@ namespace System.Web {
 			} catch {
 				// unlikely to happen
 			}
-#endif
 			
 			host_addresses = GetLocalHostAddresses ();
 		}
@@ -152,13 +147,7 @@ namespace System.Web {
 					else
 						query = worker_request.GetQueryString();
 					
-					BuildUrlComponents (
-#if NET_2_0
-						ApplyUrlMapping (worker_request.GetUriPath ()),
-#else
-						worker_request.GetUriPath (),
-#endif
-						query);
+					BuildUrlComponents (ApplyUrlMapping (worker_request.GetUriPath ()), query);
 				}
 				return url_components;
 			}
@@ -177,7 +166,6 @@ namespace System.Web {
 				url_components.Query = query.TrimStart (queryTrimChars);
 		}
 
-#if NET_2_0
 		internal string ApplyUrlMapping (string url)
 		{
 			if (urlMappings == null)
@@ -212,7 +200,6 @@ namespace System.Web {
 
 			return url_components.Path;
 		}
-#endif
 
 		string [] SplitHeader (int header_index)
 		{
@@ -238,7 +225,6 @@ namespace System.Web {
 			}
 		}
 
-#if NET_2_0
 #if !TARGET_JVM
 		public WindowsIdentity LogonUserIdentity {
 			get { throw new NotImplementedException (); }
@@ -254,7 +240,6 @@ namespace System.Web {
 				anonymous_id = value;
 			}
 		}
-#endif
 
 		public string ApplicationPath {
 			get {
@@ -278,7 +263,6 @@ namespace System.Web {
 			}
 		}
 
-#if NET_2_0		
 		internal bool BrowserMightHaveSpecialWriter {
 			get {
 				return (browser_capabilities != null 
@@ -292,7 +276,6 @@ namespace System.Web {
 					|| HttpApplicationFactory.AppBrowsersFiles.Length > 0);
 			}
 		}
-#endif
 
 		public HttpClientCertificate ClientCertificate {
 			get {
@@ -425,13 +408,11 @@ namespace System.Web {
 			}
 		}
 
-#if NET_2_0
 		public string AppRelativeCurrentExecutionFilePath {
 			get {
 				return VirtualPathUtility.ToAppRelative (CurrentExecutionFilePath);
 			}
 		}
-#endif
 
 		public string FilePath {
 			get {
@@ -439,13 +420,7 @@ namespace System.Web {
 					return "/"; // required for 2.0
 
 				if (file_path == null)
-					file_path = UrlUtils.Canonic (
-#if NET_2_0
-						ApplyUrlMapping (worker_request.GetFilePath ())
-#else
-						worker_request.GetFilePath ()
-#endif
-					);
+					file_path = UrlUtils.Canonic (ApplyUrlMapping (worker_request.GetFilePath ()));
 
 				return file_path;
 			}
@@ -736,12 +711,7 @@ namespace System.Web {
 			//
 			int content_length = ContentLength;
 			int content_length_kb = content_length / 1024;
-			
-#if NET_2_0
 			HttpRuntimeSection config = (HttpRuntimeSection) WebConfigurationManager.GetWebApplicationSection ("system.web/httpRuntime");
-#else
-			HttpRuntimeConfig config = (HttpRuntimeConfig) HttpContext.GetAppConfig ("system.web/httpRuntime");
-#endif
 			if (content_length_kb > config.MaxRequestLength)
 				throw new HttpException (400, "Upload size exceeds httpRuntime limit.");
 
@@ -936,19 +906,10 @@ namespace System.Web {
 						// use only if it's already been instantiated, so that we can't go into endless
 						// recursion in some scenarios
 						path = UrlComponents.Path;
-					} else {
-#if NET_2_0
+					} else
 						path = ApplyUrlMapping (worker_request.GetUriPath ());
-#else
-						path = worker_request.GetUriPath ();
-#endif
-					}
-						
-#if NET_2_0
+					
 					unescaped_path = Uri.UnescapeDataString (path);
-#else
-					unescaped_path = HttpUtility.UrlDecode (path);
-#endif
 				}
 				
 				return unescaped_path;
@@ -1309,13 +1270,8 @@ namespace System.Web {
 				client_target = value;
 			}
 		}
-
-#if NET_2_0
-		public
-#else
-		internal
-#endif
-		bool IsLocal {
+		
+		public bool IsLocal {
 			get {
 				string address = worker_request.GetRemoteAddress ();
 
@@ -1484,15 +1440,9 @@ namespace System.Web {
 		{
 			try {
 				string hostName = System.Net.Dns.GetHostName ();
-#if NET_2_0
 				System.Net.IPAddress [] ipaddr = System.Net.Dns.GetHostAddresses (hostName);
-#else
-				System.Net.IPAddress [] ipaddr = System.Net.Dns.GetHostByName (hostName).AddressList;
-#endif
 				return ipaddr;
-			}
-			catch
-			{
+			} catch {
 				return new System.Net.IPAddress[0];
 			}
 		}

+ 7 - 16
mcs/class/System.Web/System.Web/HttpRequestValidationException.cs

@@ -5,7 +5,7 @@
 //   	Gonzalo Paniagua Javier ([email protected])
 //	Sebastien Pouliot  <[email protected]>
 //
-// Copyright (C) 2003,2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2003-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -27,20 +27,15 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_1_1
-
 using System.Security.Permissions;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#if NET_2_0
 	[Serializable]
-#endif
-	public sealed class HttpRequestValidationException : HttpException {
-
-#if NET_2_0
+	public sealed class HttpRequestValidationException : HttpException
+	{
 		public HttpRequestValidationException ()
 		{
 		}
@@ -54,11 +49,7 @@ namespace System.Web {
 			: base (message, innerException)
 		{
 		}
-#else
-		internal HttpRequestValidationException (string msg) : base (msg)
-		{
-		}
-#endif
+
 		internal override string Description {
 			get {
 				return  "Request validation detected a potentially dangerous input value " +
@@ -75,4 +66,4 @@ namespace System.Web {
 		}
 	}
 }
-#endif
+

+ 15 - 51
mcs/class/System.Web/System.Web/HttpResponse.cs

@@ -5,8 +5,9 @@
 // Author:
 //	Miguel de Icaza ([email protected])
 //	Gonzalo Paniagua Javier ([email protected])
+//      Marek Habersack <[email protected]>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -42,11 +43,12 @@ using System.Security.Permissions;
 using System.Web.Hosting;
 using System.Web.SessionState;
 
-namespace System.Web {
-	
+namespace System.Web
+{	
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public sealed partial class HttpResponse {
+	public sealed partial class HttpResponse
+	{
 		internal HttpWorkerRequest WorkerRequest;
 		internal HttpResponseStream output_stream;
 		internal bool buffer = true;
@@ -99,11 +101,8 @@ namespace System.Web {
 		// Session State
 		//
 		string app_path_mod;
-		
-#if NET_2_0
 		bool is_request_being_redirected;
 		Encoding headerEncoding;
-#endif
 
 		internal HttpResponse ()
 		{
@@ -137,11 +136,7 @@ namespace System.Web {
 			get {
 				if (!version_header_checked && version_header == null) {
 					version_header_checked = true;
-#if NET_2_0
 					HttpRuntimeSection config = WebConfigurationManager.GetWebApplicationSection ("system.web/httpRuntime") as HttpRuntimeSection;
-#else
-					HttpRuntimeConfig config = HttpContext.GetAppConfig ("system.web/httpRuntime") as HttpRuntimeConfig;
-#endif
 					if (config != null && config.EnableVersionHeader)
 						version_header = Environment.Version.ToString (3);
 				}
@@ -287,7 +282,7 @@ namespace System.Web {
 				output_stream.Filter = value;
 			}
 		}
-#if NET_2_0
+
 		public Encoding HeaderEncoding {
 			get {
 				if (headerEncoding == null) {
@@ -314,11 +309,7 @@ namespace System.Web {
 			}
 		}
 
-		public
-#else
-		internal
-#endif
-		NameValueCollection Headers {
+		public NameValueCollection Headers {
 			get {
 				if (headers == null)
 					headers = new NameValueCollection ();
@@ -336,11 +327,11 @@ namespace System.Web {
 				return WorkerRequest.IsClientConnected ();
 			}
 		}
-#if NET_2_0
+
 		public bool IsRequestBeingRedirected {
 			get { return is_request_being_redirected; }
 		}
-#endif
+
 		public TextWriter Output {
 			get {
 				if (writer == null)
@@ -376,23 +367,13 @@ namespace System.Web {
 
 				string s = value.Substring (0, p);
 				
-#if NET_2_0
 				if (!Int32.TryParse (s, out status_code))
 					throw new HttpException ("Invalid format for the Status property");
-#else
-						    
-				try {
-					status_code = Int32.Parse (s);
-				} catch {
-					throw new HttpException ("Invalid format for the Status property");
-				}
-#endif
 				
 				status_description = value.Substring (p+1);
 			}
 		}
 
-#if NET_2_0
 		// We ignore the two properties on Mono as they are for use with IIS7, but there is
 		// no point in throwing PlatformNotSupportedException. We might find a use for them
 		// some day.
@@ -405,7 +386,6 @@ namespace System.Web {
 			get;
 			set;
 		}
-#endif
 		
 		public int StatusCode {
 			get {
@@ -447,7 +427,6 @@ namespace System.Web {
 			}
 		}
 
-#if NET_2_0
 		[MonoTODO ("Not implemented")]
 		public void AddCacheDependency (CacheDependency[] dependencies)
 		{
@@ -459,7 +438,7 @@ namespace System.Web {
 		{
 			throw new NotImplementedException ();
 		}
-#endif
+
 		[MonoTODO("Currently does nothing")]
 		public void AddCacheItemDependencies (ArrayList cacheKeys)
 		{
@@ -478,14 +457,13 @@ namespace System.Web {
 				return;
 			FileDependenciesArray.AddRange (filenames);
 		}
-#if NET_2_0
+
 		public void AddFileDependencies (string[] filenames)
 		{
 			if (filenames == null || filenames.Length == 0)
 				return;
 			FileDependenciesArray.AddRange (filenames);
 		}
-#endif		
 
 		public void AddFileDependency (string filename)
 		{
@@ -565,13 +543,9 @@ namespace System.Web {
 			}
 
 			bool cookieless = false;
-#if NET_2_0
 			SessionStateSection config = WebConfigurationManager.GetWebApplicationSection ("system.web/sessionState") as SessionStateSection;
 			cookieless = SessionStateModule.IsCookieLess (context, config);
-#else
-			SessionConfig config = HttpContext.GetAppConfig ("system.web/sessionState") as SessionConfig;
-			cookieless = config.CookieLess;
-#endif
+
 			if (!cookieless)
 				return virtualPath;
 
@@ -637,12 +611,10 @@ namespace System.Web {
 			closed = true;
 		}
 
-#if NET_2_0
 		public void DisableKernelCache ()
 		{
 			// does nothing in Mono
 		}
-#endif
 		
 		public void End ()
 		{
@@ -870,15 +842,12 @@ namespace System.Web {
 			if (headers_sent)
 				throw new HttpException ("Headers have already been sent");
 
-#if NET_2_0
 			is_request_being_redirected = true;
-#endif
 			ClearHeaders ();
 			ClearContent ();
 			
 			StatusCode = 302;
 			url = ApplyAppPathModifier (url);
-#if NET_2_0
 			HttpRuntimeSection config = WebConfigurationManager.GetWebApplicationSection ("system.web/httpRuntime") as HttpRuntimeSection;
 			if (config != null && config.UseFullyQualifiedRedirectUrl) {
 				var ub = new UriBuilder (context.Request.Url);
@@ -889,7 +858,6 @@ namespace System.Web {
 				ub.UserName = null;
 				url = ub.Uri.ToString ();
 			}
-#endif
 			redirect_location = url;
 
 			// Text for browsers that can't handle location header
@@ -899,9 +867,7 @@ namespace System.Web {
 			
 			if (endResponse)
 				End ();
-#if NET_2_0
 			is_request_being_redirected = false;
-#endif
 		}
 
 		public static void RemoveOutputCacheItem (string path)
@@ -1033,7 +999,7 @@ namespace System.Web {
 			output_stream.ApplyFilter (false);
 			Flush ();
 		}
-#if NET_2_0
+
 		public void WriteSubstitution (HttpResponseSubstitutionCallback callback)
 		{
 			// Emulation of .NET behavior
@@ -1061,7 +1027,7 @@ namespace System.Web {
 			
 			cached_response.SetData (callback);
 		}
-#endif
+
 		//
 		// Like WriteFile, but never buffers, so we manually Flush here
 		//
@@ -1082,7 +1048,6 @@ namespace System.Web {
 			Flush (final_flush);
 		}
 
-#if NET_2_0
 		public void TransmitFile (string filename, long offset, long length)
 		{
 			output_stream.WriteFile (filename, offset, length);
@@ -1118,7 +1083,6 @@ namespace System.Web {
 					Flush (true);
 			}
 		}
-#endif
 		
 #region Session state support
 		internal void SetAppPathModifier (string app_modifier)

+ 7 - 9
mcs/class/System.Web/System.Web/HttpResponseHeader.cs

@@ -6,7 +6,7 @@
 //
 
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -32,9 +32,10 @@ using System.Collections;
 using System.Text;
 using System.Web.Configuration;
 
-namespace System.Web {
-
-	internal abstract class BaseResponseHeader {
+namespace System.Web
+{
+	abstract class BaseResponseHeader
+	{
 		string headerValue;
 		
 		public string Value {
@@ -44,12 +45,9 @@ namespace System.Web {
 	  
 		static bool headerCheckingEnabled;
 		
-		static BaseResponseHeader () {
-#if NET_2_0
+		static BaseResponseHeader ()
+		{
 			HttpRuntimeSection section = WebConfigurationManager.GetWebApplicationSection ("system.web/httpRuntime") as HttpRuntimeSection;
-#else
-			HttpRuntimeConfig section = HttpContext.GetAppConfig ("system.web/httpRuntime") as HttpRuntimeConfig;
-#endif
 			headerCheckingEnabled = section == null || section.EnableHeaderChecking;
 		}
 

+ 5 - 15
mcs/class/System.Web/System.Web/HttpResponseStream.cs

@@ -7,7 +7,7 @@
 //	Ben Maurer ([email protected])
 //
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -35,8 +35,8 @@ using System.Text;
 using System.Globalization;
 using System.Runtime.InteropServices;
 	
-namespace System.Web {
-
+namespace System.Web
+{
 	//
 	// HttpResponseStream implements the "OutputStream" from HttpResponse
 	//
@@ -47,7 +47,8 @@ namespace System.Web {
 	// You must call HttpResponse.Flush which does the actual header generation
 	// and actual data flushing
 	//
-	internal class HttpResponseStream : Stream {
+	class HttpResponseStream : Stream
+	{
 		Bucket first_bucket;
 		Bucket cur_bucket;
 		HttpResponse response;
@@ -516,27 +517,16 @@ namespace System.Web {
 		public override void Write (byte [] buffer, int offset, int count)
 		{
 			bool buffering = response.BufferOutput;
-
-#if NET_2_0
 			if (buffer == null)
 				throw new ArgumentNullException ("buffer");
-#endif
 
 			int max_count = buffer.Length - offset;
-#if NET_2_0
 			if (offset < 0 || max_count <= 0)
-#else
-			if (offset < 0)
-#endif
 				throw new ArgumentOutOfRangeException ("offset");
 			if (count < 0)
 				throw new ArgumentOutOfRangeException ("count");
 			if (count > max_count)
 				count = max_count;
-#if ONLY_1_1
-			if (max_count <= 0)
-				return;
-#endif
 
 			if (buffering) {
 				// It does not matter whether we're in ApplyFilter or not

+ 3 - 7
mcs/class/System.Web/System.Web/HttpResponseSubstitutionCallback.cs

@@ -4,7 +4,7 @@
 // Author:
 //	Sebastien Pouliot  <[email protected]>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -26,12 +26,8 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
-namespace System.Web {
-
+namespace System.Web
+{
 	public delegate string HttpResponseSubstitutionCallback (HttpContext context);
-
 }
 
-#endif

+ 10 - 37
mcs/class/System.Web/System.Web/HttpRuntime.cs

@@ -1,11 +1,12 @@
 //
 // System.Web.HttpRuntime.cs 
 // 
-// Author:
+// Authors:
 //	Miguel de Icaza ([email protected])
+//      Marek Habersack <[email protected]>
 //
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -47,18 +48,17 @@ using Mono.Web.Util;
 using System.Threading;
 #if TARGET_J2EE
 using Mainsoft.Web;
-#endif
-
-#if NET_2_0 && !TARGET_JVM
+#else
 using System.CodeDom.Compiler;
 using System.Web.Compilation;
 #endif
 
-namespace System.Web {
-	
+namespace System.Web
+{	
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public sealed class HttpRuntime {
+	public sealed class HttpRuntime
+	{
 		static bool caseInsensitive;
 		static bool runningOnWindows;
 		static bool isunc;
@@ -118,16 +118,10 @@ namespace System.Web {
 		static WaitCallback do_RealProcessRequest;
 		static Exception initialException;
 		static bool firstRun;
-		
-#if NET_2_0
 		static bool assemblyMappingEnabled;
 		static object assemblyMappingLock = new object ();
 		static object appOfflineLock = new object ();
-#endif
 		
-#if ONLY_1_1
-		[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
-#endif
 		public HttpRuntime ()
 		{
 
@@ -137,11 +131,7 @@ namespace System.Web {
 		static HttpRuntime ()
 		{
 			PlatformID pid = Environment.OSVersion.Platform;
-			runningOnWindows = ((int) pid != 128
-#if NET_2_0
-					    && pid != PlatformID.Unix && pid != PlatformID.MacOSX
-#endif
-			);
+			runningOnWindows = ((int) pid != 128 && pid != PlatformID.Unix && pid != PlatformID.MacOSX);
 
 			if (runningOnWindows) {
 				caseInsensitive = true;
@@ -177,7 +167,6 @@ namespace System.Web {
 			
 #if !TARGET_J2EE
 			firstRun = true;
-#if NET_2_0
 			try {
 				WebConfigurationManager.Init ();
 #if MONOWEB_DEP
@@ -186,7 +175,6 @@ namespace System.Web {
 			} catch (Exception ex) {
 				initialException = ex;
 			}
-#endif
 
 			// The classes in whose constructors exceptions may be thrown, should be handled the same way QueueManager
 			// and TraceManager are below. The constructors themselves MUST NOT throw any exceptions - we MUST be sure
@@ -360,7 +348,6 @@ namespace System.Web {
 		}
 
 #if !TARGET_J2EE
-#if NET_2_0
 		static readonly string[] app_offline_files = {"app_offline.htm", "App_Offline.htm", "APP_OFFLINE.HTM"};
 		static string app_offline_file;
 		
@@ -470,7 +457,6 @@ namespace System.Web {
 					SetOfflineMode (true, offlineFile);
 			}
 		}
-#endif
 #endif
 		
 		static void RealProcessRequest (object o)
@@ -498,9 +484,7 @@ namespace System.Web {
 			bool error = false;
 #if !TARGET_J2EE
 			if (firstRun) {
-#if NET_2_0
 				SetupOfflineWatch ();
-#endif
 				firstRun = false;
 				if (initialException != null) {
 					FinishWithException (req, new HttpException ("Initial exception", initialException));
@@ -508,10 +492,8 @@ namespace System.Web {
 				}
 			}
 
-#if NET_2_0
 			if (AppIsOffline (context))
 				return;
-#endif
 #endif
 			
 			//
@@ -681,7 +663,6 @@ namespace System.Web {
 			HttpApplication.requests_total_counter.Increment ();
 		}
 
-#if NET_2_0 
 #if !TARGET_J2EE
 		static internal void WritePreservationFile (Assembly asm, string genericNameBase)
 		{
@@ -749,7 +730,7 @@ namespace System.Web {
 			}
 		}
 #endif // #if !TARGET_J2EE
-#endif
+
 		internal static string MonoVersion {
 			get { return monoVersion; }
 		}
@@ -764,19 +745,11 @@ namespace System.Web {
 
 		internal static bool IsDebuggingEnabled {
 			get {
-#if NET_2_0
 				CompilationSection cs = WebConfigurationManager.GetSection ("system.web/compilation") as CompilationSection;
 				if (cs != null)
 					return cs.Debug;
 
 				return false;
-#else
-				try {
-					return CompilationConfiguration.GetInstance (HttpContext.Current).Debug;
-				} catch {
-					return false;
-				}
-#endif
 			}
 		}
 		

+ 12 - 26
mcs/class/System.Web/System.Web/HttpServerUtility.cs

@@ -8,7 +8,7 @@
 //
 
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -39,8 +39,8 @@ using System.Text;
 using System.Web.Configuration;
 using System.Web.SessionState;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	//
 	// Methods exposed through HttpContext.Server property
 	//
@@ -88,19 +88,12 @@ namespace System.Web {
 			Execute (path, writer, true);
 		}
 
-#if NET_2_0
 		public void Execute (string path, bool preserveForm)
 		{
 			Execute (path, null, preserveForm);
 		}
-#endif
-		
-#if NET_2_0
-		public
-#else
-		internal
-#endif
-		void Execute (string path, TextWriter writer, bool preserveForm)
+
+		public void Execute (string path, TextWriter writer, bool preserveForm)
 		{			
 			Execute (path, writer, preserveForm, false);
 		}
@@ -122,14 +115,9 @@ namespace System.Web {
 
 			string exePath = UrlUtils.Combine (context.Request.BaseVirtualDir, path);
 			bool cookieless = false;
-			
-#if NET_2_0
 			SessionStateSection config = WebConfigurationManager.GetWebApplicationSection ("system.web/sessionState") as SessionStateSection;
 			cookieless = SessionStateModule.IsCookieLess (context, config);
-#else
-			SessionConfig config = HttpContext.GetAppConfig ("system.web/sessionState") as SessionConfig;
-			cookieless = config.CookieLess;
-#endif
+			
 			if (cookieless)
 				exePath = UrlUtils.RemoveSessionId (VirtualPathUtility.GetDirectory (exePath), exePath);
 			
@@ -137,8 +125,9 @@ namespace System.Web {
 			Execute (handler, writer, preserveForm, exePath, queryString, isTransfer, true);
 		}
 
-		internal void Execute (IHttpHandler handler, TextWriter writer, bool preserveForm, string exePath, string queryString, bool isTransfer, bool isInclude) {
-#if NET_2_0 && !TARGET_J2EE
+		internal void Execute (IHttpHandler handler, TextWriter writer, bool preserveForm, string exePath, string queryString, bool isTransfer, bool isInclude)
+		{
+#if !TARGET_J2EE
 			// If the target handler is not Page, the transfer must not occur.
 			// InTransit == true means we're being called from Transfer
 			bool is_static = (handler is StaticFileHandler);
@@ -168,11 +157,10 @@ namespace System.Web {
 			string oldExePath = request.CurrentExecutionFilePath;
 			bool oldIsInclude = context.IsProcessingInclude;
 			try {
-#if NET_2_0
 				context.PushHandler (handler);
 				if (is_static) // Not sure if this should apply to Page too
 					request.SetFilePath (exePath);
-#endif
+
 				request.SetCurrentExePath (exePath);
 				context.IsProcessingInclude = isInclude;
 				
@@ -196,9 +184,8 @@ namespace System.Web {
 				response.SetTextWriter (previous);
 				if (!preserveForm)
 					request.SetForm (oldForm);
-#if NET_2_0
+
 				context.PopHandler ();
-#endif
 				request.SetCurrentExePath (oldExePath);
 				context.IsProcessingInclude = oldIsInclude;
 			}
@@ -245,7 +232,7 @@ namespace System.Web {
 			Execute (path, null, preserveForm, true);
 			context.Response.End ();
 		}
-#if NET_2_0
+
 		public void Transfer (IHttpHandler handler, bool preserveForm)
 		{
 			if (handler == null)
@@ -345,7 +332,6 @@ namespace System.Web {
 			}
 			return new string (chars);
 		}
-#endif
 
 		public string UrlDecode (string s)
 		{

+ 5 - 14
mcs/class/System.Web/System.Web/HttpStaticObjectsCollection.cs

@@ -25,14 +25,15 @@ using System.IO;
 using System.Security.Permissions;
 using System.Web.UI;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public sealed class HttpStaticObjectsCollection : ICollection, IEnumerable {
+	public sealed class HttpStaticObjectsCollection : ICollection, IEnumerable
+	{
 		Hashtable _Objects;
 
-		class StaticItem {
+		sealed class StaticItem {
 			object this_lock = new object();
 			
 			Type type;
@@ -117,12 +118,10 @@ namespace System.Web {
 			get { return false; }
 		}
 
-#if NET_2_0
 		[MonoTODO ("Not implemented")]
 		public bool NeverAccessed {
 			get { throw new NotImplementedException (); }
 		}
-#endif
 
 		public object SyncRoot {
 			get { return this; }
@@ -150,11 +149,7 @@ namespace System.Web {
 			_Objects [name] = obj;
 		}
 
-#if NET_2_0
 		public void Serialize (BinaryWriter writer)
-#else
-		internal void Serialize (BinaryWriter writer)
-#endif
 		{
 			writer.Write (_Objects.Count);
 			foreach (string key in _Objects.Keys) {
@@ -163,11 +158,7 @@ namespace System.Web {
 			}
 		}
 
-#if NET_2_0
 		public static HttpStaticObjectsCollection Deserialize (BinaryReader reader)
-#else
-		internal static HttpStaticObjectsCollection Deserialize (BinaryReader reader)
-#endif
 		{
 			HttpStaticObjectsCollection result = new HttpStaticObjectsCollection ();
 			for (int i = reader.ReadInt32 (); i > 0; i--)

+ 5 - 14
mcs/class/System.Web/System.Web/HttpUnhandledException.cs

@@ -6,7 +6,7 @@
 //	Sebastien Pouliot  <[email protected]>
 //
 // Copyright (C) Tim Coleman, 2002
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -30,16 +30,13 @@
 
 using System.Security.Permissions;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#if NET_2_0
 	[Serializable]
-#endif
-	public sealed class HttpUnhandledException : HttpException {
-
-#if NET_2_0
+	public sealed class HttpUnhandledException : HttpException
+	{
 		public HttpUnhandledException ()
 		{
 		}
@@ -53,11 +50,5 @@ namespace System.Web {
 			: base (message, innerException)
 		{
 		}
-#else
-		internal HttpUnhandledException (string message, Exception innerException)
-			: base (message, innerException)
-		{
-		}
-#endif
 	}
 }

+ 25 - 43
mcs/class/System.Web/System.Web/HttpUtility.cs

@@ -7,7 +7,7 @@
 //   Tim Coleman ([email protected])
 //   Gonzalo Paniagua Javier ([email protected])
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -30,6 +30,7 @@
 //
 
 using System.Collections;
+using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.IO;
@@ -37,18 +38,31 @@ using System.Security.Permissions;
 using System.Text;
 using System.Web.Util;
 
-#if NET_2_0
-using System.Collections.Generic;
-#endif
-
 namespace System.Web {
 
 #if !MONOTOUCH
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 #endif
-
-	public sealed class HttpUtility {
+	public sealed class HttpUtility
+	{
+		sealed class HttpQSCollection : NameValueCollection
+		{
+			public override string ToString ()
+			{
+				int count = Count;
+				if (count == 0)
+					return "";
+				StringBuilder sb = new StringBuilder ();
+				string [] keys = AllKeys;
+				for (int i = 0; i < count; i++) {
+					sb.AppendFormat ("{0}={1}&", keys [i], this [keys [i]]);
+				}
+				if (sb.Length > 0)
+					sb.Length--;
+				return sb.ToString ();
+			}
+		}
 		#region Fields
 	
 		static Hashtable entities;
@@ -409,11 +423,7 @@ namespace System.Web {
 				e = Encoding.UTF8;
 
 			long len = s.Length;
-#if NET_2_0
 			var bytes = new List <byte> ();
-#else
-			ArrayList bytes = new ArrayList ();
-#endif
 			int xchar;
 			char ch;
 			
@@ -443,11 +453,7 @@ namespace System.Web {
 					WriteCharBytes (bytes, ch, e);
 			}
 			
-#if NET_2_0
 			byte[] buf = bytes.ToArray ();
-#else
-			byte[] buf = (byte[])bytes.ToArray (typeof (byte));
-#endif
 			bytes = null;
 			return e.GetString (buf);
 			
@@ -1005,7 +1011,6 @@ namespace System.Web {
 				output.Write (HtmlEncode (s));
 		}
 
-#if NET_1_1
 		public static string UrlPathEncode (string s)
 		{
 			if (s == null || s.Length == 0)
@@ -1013,18 +1018,15 @@ namespace System.Web {
 
 			MemoryStream result = new MemoryStream ();
 			int length = s.Length;
-            for (int i = 0; i < length; i++) {
+			for (int i = 0; i < length; i++) {
 				UrlPathEncodeChar (s [i], result);
 			}
 			return Encoding.ASCII.GetString (result.ToArray ());
 		}
 		
-		static void UrlPathEncodeChar (char c, Stream result) {
-#if NET_2_0
+		static void UrlPathEncodeChar (char c, Stream result)
+		{
 			if (c < 33 || c > 126) {
-#else
-			if (c > 127) {
-#endif
 				byte [] bIn = Encoding.UTF8.GetBytes (c.ToString ());
 				for (int i = 0; i < bIn.Length; i++) {
 					result.WriteByte ((byte) '%');
@@ -1042,25 +1044,6 @@ namespace System.Web {
 			else
 				result.WriteByte ((byte) c);
 		}
-#endif
-
-#if NET_2_0
-		class HttpQSCollection : NameValueCollection {
-			public override string ToString ()
-			{
-				int count = Count;
-				if (count == 0)
-					return "";
-				StringBuilder sb = new StringBuilder ();
-				string [] keys = AllKeys;
-				for (int i = 0; i < count; i++) {
-					sb.AppendFormat ("{0}={1}&", keys [i], this [keys [i]]);
-				}
-				if (sb.Length > 0)
-					sb.Length--;
-				return sb.ToString ();
-			}
-		}
 
 		public static NameValueCollection ParseQueryString (string query)
 		{
@@ -1081,8 +1064,7 @@ namespace System.Web {
 			NameValueCollection result = new HttpQSCollection ();
 			ParseQueryString (query, encoding, result);
 			return result;
-		} 				
-#endif
+		}
 
 		internal static void ParseQueryString (string query, Encoding encoding, NameValueCollection result)
 		{

+ 4 - 5
mcs/class/System.Web/System.Web/HttpValidationStatus.cs

@@ -28,11 +28,10 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-namespace System.Web {
-#if !NET_2_0
-	[Serializable]
-#endif
-        public enum HttpValidationStatus {
+namespace System.Web
+{
+        public enum HttpValidationStatus
+	{
                 Invalid = 0x1,
                 IgnoreThisRequest,
                 Valid

+ 14 - 46
mcs/class/System.Web/System.Web/HttpWorkerRequest.cs

@@ -6,7 +6,7 @@
 //
 
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -29,24 +29,21 @@
 //
 
 using System.Collections;
+using System.Collections.Generic;
+using System.Collections.Specialized;
 using System.Runtime.InteropServices;
 using System.Security.Permissions;
 using System.Web.UI;
-using System.Collections.Specialized;
-
-#if NET_2_0
-using System.Collections.Generic;
-#endif
-
-namespace System.Web {
 
+namespace System.Web
+{
 	// CAS
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	// attributes
 	[ComVisible (false)]
-	public abstract partial class HttpWorkerRequest {
-
+	public abstract partial class HttpWorkerRequest
+	{
 		public delegate void EndOfSendNotification (HttpWorkerRequest wr, object extraData);
 
 		public const int HeaderCacheControl = 0;
@@ -109,31 +106,16 @@ namespace System.Web {
 		public const int ReasonCacheSecurity = 3;
 		public const int ReasonClientDisconnect = 4;
 		public const int ReasonDefault = 0;
-
-#if NET_2_0
 		static readonly Dictionary <string, int> RequestHeaderIndexer;
 		static readonly Dictionary <string, int> ResponseHeaderIndexer;
-#else
-		static readonly Hashtable RequestHeaderIndexer;
-		static readonly Hashtable ResponseHeaderIndexer;
-#endif
 		
 		static HttpWorkerRequest ()
 		{
-#if NET_2_0
-			RequestHeaderIndexer = new Dictionary <string, int> (StringComparer.OrdinalIgnoreCase);
-#else
-			RequestHeaderIndexer = CollectionsUtil.CreateCaseInsensitiveHashtable(RequestHeaderMaximum);
-#endif
-			
+			RequestHeaderIndexer = new Dictionary <string, int> (StringComparer.OrdinalIgnoreCase);			
 			for (int i = 0; i < RequestHeaderMaximum; i++)
 				RequestHeaderIndexer.Add (GetKnownRequestHeaderName(i), i);
 
-#if NET_2_0
 			ResponseHeaderIndexer = new Dictionary <string, int> (StringComparer.OrdinalIgnoreCase);
-#else
-			ResponseHeaderIndexer = CollectionsUtil.CreateCaseInsensitiveHashtable(ResponseHeaderMaximum);
-#endif
 			for (int i = 0; i < ResponseHeaderMaximum; i++)
 				ResponseHeaderIndexer.Add (GetKnownResponseHeaderName(i), i);
 		}
@@ -156,7 +138,6 @@ namespace System.Web {
 			}
 		}
 
-#if NET_2_0
 		public virtual Guid RequestTraceIdentifier {
 			get { return Guid.Empty; }
 		}
@@ -164,7 +145,6 @@ namespace System.Web {
 		public virtual string RootWebConfigPath {
 			get { return null; }
 		}
-#endif
 
 		public virtual void CloseConnection ()
 		{
@@ -214,7 +194,7 @@ namespace System.Web {
 		{
 			return null;
 		}
-#if NET_2_0
+
 		public virtual int GetPreloadedEntityBody (byte[] buffer, int offset)
 		{
 			return 0;
@@ -224,7 +204,7 @@ namespace System.Web {
 		{
 			return 0;
 		}
-#endif
+
 		public virtual string GetProtocol ()
 		{
 			if (IsSecure ())
@@ -257,12 +237,12 @@ namespace System.Web {
 		{
 			return null;
 		}
-#if NET_2_0
+
 		public virtual int GetTotalEntityBodyLength ()
 		{
 			return 0;
 		}
-#endif
+
 		public virtual string GetUnknownRequestHeader (string name)
 		{
 			return null;
@@ -315,7 +295,7 @@ namespace System.Web {
 		{
 			return 0;
 		}
-#if NET_2_0
+
 		public virtual int ReadEntityBody (byte [] buffer, int offset, int size)
 		{
 			return 0;
@@ -325,7 +305,7 @@ namespace System.Web {
 		{
 			SendCalculatedContentLength ((int)contentLength);
 		}
-#endif
+
 		public virtual void SendCalculatedContentLength (int contentLength)
 		{
 			// apparently does nothing in MS.NET
@@ -370,15 +350,9 @@ namespace System.Web {
 		
 		public static int GetKnownRequestHeaderIndex (string header)
 		{
-#if NET_2_0
 			int index;
 			if (RequestHeaderIndexer.TryGetValue (header, out index))
 				return index;
-#else
-			object index = RequestHeaderIndexer[header];
-			if (index != null)
-				return (int)index;
-#endif
 
 			return -1;
 		}
@@ -433,15 +407,9 @@ namespace System.Web {
 
 		public static int GetKnownResponseHeaderIndex (string header)
 		{
-#if NET_2_0
 			int index;
 			if (ResponseHeaderIndexer.TryGetValue (header, out index))
 				return index;
-#else
-			object index = ResponseHeaderIndexer[header];
-			if (index != null)
-				return (int)index;
-#endif
 
 			return -1;
 		}

+ 5 - 4
mcs/class/System.Web/System.Web/HttpWriter.cs

@@ -6,7 +6,7 @@
 //	Miguel de Icaza ([email protected])
 //
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -34,11 +34,12 @@ using System.Globalization;
 using System.Runtime.InteropServices;
 using System.Security.Permissions;
 	
-namespace System.Web {
-	
+namespace System.Web
+{	
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public sealed class HttpWriter : TextWriter {
+	public sealed class HttpWriter : TextWriter
+	{
 		HttpResponseStream output_stream;
 		HttpResponse response;
 		Encoding encoding;

+ 0 - 2
mcs/class/System.Web/System.Web/IPartitionResolver.cs

@@ -26,7 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System;
 using System.Security.Permissions;
 
@@ -40,4 +39,3 @@ namespace System.Web
 		string ResolvePartition (object key);
 	}
 }
-#endif

+ 1 - 2
mcs/class/System.Web/System.Web/IisTraceListener.cs

@@ -25,7 +25,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.Diagnostics;
 using System.Runtime.InteropServices;
@@ -87,4 +87,3 @@ namespace System.Web
 		}
 	}
 }
-#endif

+ 4 - 20
mcs/class/System.Web/System.Web/MimeTypes.cs

@@ -5,7 +5,7 @@
 //	Gonzalo Paniagua Javier ([email protected])
 //
 // (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
+// (C) 2003-2009 Novell, Inc (http://novell.com)
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
@@ -30,28 +30,17 @@
 
 using System;
 using System.Collections;
-#if NET_2_0
 using System.Collections.Generic;
-#endif
 
 namespace System.Web
 {
-	class MimeTypes
+	sealed class MimeTypes
 	{
-#if NET_2_0
 		static Dictionary <string, string> mimeTypes;
-#else
-		static Hashtable mimeTypes;
-#endif
 		
 		static MimeTypes ()
 		{
-#if NET_2_0
-			mimeTypes = new Dictionary <string, string> (StringComparer.InvariantCultureIgnoreCase);
-#else
-			mimeTypes = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant,
-						   CaseInsensitiveComparer.DefaultInvariant);
-#endif
+			mimeTypes = new Dictionary <string, string> (StringComparer.OrdinalIgnoreCase);
 			mimeTypes.Add ("323", "text/h323");
 			mimeTypes.Add ("3dmf", "x-world/x-3dmf");
 			mimeTypes.Add ("3dm", "x-world/x-3dmf");
@@ -551,13 +540,8 @@ namespace System.Web
 			string result = null;
 			int dot = fileName.LastIndexOf ('.');
 
-			if (dot != -1 && fileName.Length > dot + 1) {
-#if NET_2_0
+			if (dot != -1 && fileName.Length > dot + 1)
 				mimeTypes.TryGetValue (fileName.Substring (dot + 1), out result);
-#else
-				result = mimeTypes [fileName.Substring (dot + 1)] as string;
-#endif
-			}
 			
 			if (result == null)
 				result = "application/octet-stream";

+ 3 - 7
mcs/class/System.Web/System.Web/NoParamsInvoker.cs

@@ -6,6 +6,7 @@
 // 	Gonzalo Paniagua Javier ([email protected])
 //
 // (c) 2003 Ximian, Inc. (http://www.ximian.com)
+// (c) 2003-2009 Novell, Inc (http://novell.com)
 //
 
 //
@@ -33,7 +34,7 @@ using System.Reflection;
 namespace System.Web
 {
 	delegate void NoParamsDelegate ();
-	class NoParamsInvoker
+	sealed class NoParamsInvoker
 	{
 		EventHandler faked;
 		NoParamsDelegate real;
@@ -44,12 +45,7 @@ namespace System.Web
 				real = (NoParamsDelegate) Delegate.CreateDelegate (
 					typeof (NoParamsDelegate), method);
 			else
-				real = (NoParamsDelegate) Delegate.CreateDelegate (
-#if NET_2_0
-						typeof (NoParamsDelegate), o, method);
-#else
-						typeof (NoParamsDelegate), o, method.Name);
-#endif
+				real = (NoParamsDelegate) Delegate.CreateDelegate (typeof (NoParamsDelegate), o, method);
 			 faked = new EventHandler (InvokeNoParams);
 		}
 

+ 5 - 4
mcs/class/System.Web/System.Web/OutputFilterStream.cs

@@ -4,7 +4,7 @@
 // Author:
 //   Gonzalo Paniagua Javier ([email protected]
 //
-// (c) 2005 Novell, Inc. (http://www.novell.com)
+// (c) 2005-2009 Novell, Inc. (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -29,9 +29,10 @@
 using System.Runtime.InteropServices;
 using System.IO;
 
-namespace System.Web {
-
-	class OutputFilterStream : Stream {
+namespace System.Web
+{
+	sealed class OutputFilterStream : Stream
+	{
 		HttpResponseStream stream;
 
 		public OutputFilterStream (HttpResponseStream stream)

+ 3 - 5
mcs/class/System.Web/System.Web/ParserError.cs

@@ -4,7 +4,7 @@
 // Authors:
 //	Lluis Sanchez Gual ([email protected])
 //
-// (C) 2004 Novell, Inc (http://www.novell.com)
+// (C) 2004-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -28,12 +28,11 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 
 using System.Runtime.Serialization;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	[Serializable]
 	public sealed class ParserError
 	{
@@ -69,4 +68,3 @@ namespace System.Web {
 	}
 }
 
-#endif

+ 3 - 6
mcs/class/System.Web/System.Web/ParserErrorCollection.cs

@@ -4,7 +4,7 @@
 // Authors:
 //	Lluis Sanchez Gual ([email protected])
 //
-// (C) 2004 Novell, Inc (http://www.novell.com)
+// (C) 2004-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -28,13 +28,11 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System.Collections;
 using System.Runtime.Serialization;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	[Serializable]
 	public sealed class ParserErrorCollection: CollectionBase
 	{
@@ -95,4 +93,3 @@ namespace System.Web {
 	}
 }
 
-#endif

+ 4 - 5
mcs/class/System.Web/System.Web/ProcessShutdownReason.cs

@@ -28,11 +28,10 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-namespace System.Web {
-#if !NET_2_0
-	[Serializable]
-#endif
-	public enum ProcessShutdownReason {
+namespace System.Web 
+{
+	public enum ProcessShutdownReason 
+	{
 		None,
 		Unexpected,
 		RequestsLimit,

+ 2 - 8
mcs/class/System.Web/System.Web/QueueManager.cs

@@ -4,7 +4,7 @@
 // Authors:
 //	Gonzalo Paniagua Javier ([email protected])
 //
-// (C) 2003,2004 Novell, Inc (http://www.novell.com)
+// (C) 2003-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -37,7 +37,7 @@ using System.Web.Configuration;
 
 namespace System.Web
 {
-	class QueueManager
+	sealed class QueueManager
 	{
 		// keep the defaults in sync with the ones in HttpRuntimeSection.cs
 		int minFree = 8;
@@ -53,15 +53,9 @@ namespace System.Web
 			Exception ex = null;
 			
 			try {
-#if NET_2_0
 				HttpRuntimeSection config;
 
 				config = (HttpRuntimeSection) WebConfigurationManager.GetWebApplicationSection ("system.web/httpRuntime");
-#else
-				HttpRuntimeConfig config;
-
-				config = (HttpRuntimeConfig) HttpContext.GetAppConfig ("system.web/httpRuntime");
-#endif
 				minFree = config.MinFreeThreads;
 				minLocalFree = config.MinLocalRequestFreeThreads;
 				queueLimit = config.AppRequestQueueLimit;

+ 1 - 3
mcs/class/System.Web/System.Web/RequestNotification.cs

@@ -4,7 +4,7 @@
 // Authors:
 //   Marek Habersack ([email protected])
 //
-// (C) 2007 Novell, Inc
+// (C) 2007-2009 Novell, Inc (http://novell.com)
 //
 
 //
@@ -27,7 +27,6 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
 namespace System.Web 
 {
 	[FlagsAttribute]
@@ -48,4 +47,3 @@ namespace System.Web
 		SendResponse = 0x20000000
 	}
 }
-#endif

+ 1 - 3
mcs/class/System.Web/System.Web/RequestNotificationStatus.cs

@@ -4,7 +4,7 @@
 // Authors:
 //   Marek Habersack ([email protected])
 //
-// (C) 2007 Novell, Inc
+// (C) 2007-2009 Novell, Inc (http://novell.com)
 //
 
 //
@@ -27,7 +27,6 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
 using System;
 using System.Collections.Generic;
 using System.Security.Permissions;
@@ -41,4 +40,3 @@ namespace System.Web
 		FinishRequest
 	}
 }
-#endif

+ 5 - 5
mcs/class/System.Web/System.Web/SiteMap.cs

@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Text;
@@ -36,9 +35,10 @@ using System.Configuration.Provider;
 using System.Configuration;
 using System.Web.Configuration;
 
-namespace System.Web {
-	public static class SiteMap {
-	
+namespace System.Web
+{
+	public static class SiteMap
+	{
 		static void Init ()
 		{
 			lock (locker) {
@@ -113,5 +113,5 @@ namespace System.Web {
 		static object locker = new object ();
 	}
 }
-#endif
+
 

+ 1 - 2
mcs/class/System.Web/System.Web/SiteMapNode.cs

@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Text;
@@ -448,5 +447,5 @@ namespace System.Web {
 		
 	}
 }
-#endif
+
 

+ 2 - 3
mcs/class/System.Web/System.Web/SiteMapNodeCollection.cs

@@ -6,7 +6,7 @@
 //	Lluis Sanchez Gual ([email protected])
 //
 //  (C) 2003 Ben Maurer
-//  (C) 2005 Novell, Inc (http://www.novell.com)
+//  (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -30,7 +30,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Text;
@@ -307,5 +306,5 @@ namespace System.Web
 		#endregion
 	}
 }
-#endif
+
 

+ 6 - 5
mcs/class/System.Web/System.Web/SiteMapProvider.cs

@@ -6,7 +6,7 @@
 //	Lluis Sanchez Gual ([email protected])
 //
 // (C) 2003 Ben Maurer
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -30,7 +30,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.ComponentModel;
 using System.Collections;
 using System.Collections.Specialized;
@@ -40,8 +39,10 @@ using System.Web.Util;
 using System.Globalization;
 using System.Web.Configuration;
 
-namespace System.Web {
-	public abstract class SiteMapProvider : ProviderBase {
+namespace System.Web
+{
+	public abstract class SiteMapProvider : ProviderBase
+	{
 		static readonly object siteMapResolveEvent = new object ();
 		
 		internal object this_lock = new object ();
@@ -309,5 +310,5 @@ namespace System.Web {
 		}
 	}
 }
-#endif
+
 

+ 2 - 3
mcs/class/System.Web/System.Web/SiteMapProviderCollection.cs

@@ -6,7 +6,7 @@
 //	Lluis Sanchez Gual ([email protected])
 //
 //  (C) 2003 Ben Maurer
-//  (C) 2005 Novell, Inc (http://www.novell.com)
+//  (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -30,7 +30,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Text;
@@ -69,5 +68,5 @@ namespace System.Web {
 		}
 	}
 }
-#endif
+
 

+ 1 - 3
mcs/class/System.Web/System.Web/SiteMapResolveEventArgs.cs

@@ -28,8 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 
 namespace System.Web
@@ -56,5 +54,5 @@ namespace System.Web
 		}
 	}
 }
-#endif
+
 

+ 1 - 2
mcs/class/System.Web/System.Web/StaticFileHandler.cs

@@ -5,6 +5,7 @@
 //	Gonzalo Paniagua Javier ([email protected])
 //
 // (C) 2002 Ximian, Inc (http://www.ximian.com)
+// (C) 2003-2009 Novell, Inc (http://novell.com)
 //
 
 //
@@ -54,7 +55,6 @@ namespace System.Web
 			HttpRequest request = context.Request;
 			HttpResponse response = context.Response;
 
-#if NET_2_0
 			if (HostingEnvironment.HaveCustomVPP) {
 				VirtualFile vf = null;
 				VirtualPathProvider vpp = HostingEnvironment.VirtualPathProvider;
@@ -70,7 +70,6 @@ namespace System.Web
 				response.TransmitFile (vf, true);
 				return;
 			}
-#endif
 			
 			string fileName = request.PhysicalPath;
 			FileInfo fi = new FileInfo (fileName);

+ 1 - 3
mcs/class/System.Web/System.Web/StaticSiteMapProvider.cs

@@ -30,8 +30,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-
-#if NET_2_0
 using System.Collections.Generic;
 using System.Web.Util;
 
@@ -224,5 +222,5 @@ namespace System.Web
 		}
 	}
 }
-#endif
+
 

+ 6 - 18
mcs/class/System.Web/System.Web/TraceContext.cs

@@ -6,7 +6,7 @@
 //   Jackson Harper ([email protected])
 //
 // (C) 2002 2003, Patrik Torstensson
-// Copyright (C) 2003,2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2003-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -33,14 +33,13 @@ using System.Collections;
 using System.Security.Permissions;
 using System.Web.UI;
 
-namespace System.Web {
-
+namespace System.Web
+{
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public sealed class TraceContext {
-#if NET_2_0
+	public sealed class TraceContext
+	{
 		static readonly object traceFinishedEvent = new object ();
-#endif
 		
 		HttpContext _Context;
 		TraceManager _traceManager;
@@ -50,19 +49,14 @@ namespace System.Web {
 		bool data_saved;
 		bool _haveTrace;
 		Hashtable view_states;
-#if NET_2_0
 		Hashtable control_states;
-#endif
-		Hashtable sizes;
-		
-#if NET_2_0
+		Hashtable sizes;		
 		EventHandlerList events = new EventHandlerList ();
 		
 		public event TraceContextEventHandler TraceFinished {
 			add { events.AddHandler (traceFinishedEvent, value); }
 			remove { events.AddHandler (traceFinishedEvent, value); }
 		}
-#endif
 
 		public TraceContext (HttpContext Context)
 		{
@@ -158,11 +152,7 @@ namespace System.Web {
 
 			SetRequestDetails ();
 			if (_Context.Handler is Page)
-#if NET_2_0
 				data.AddControlTree ((Page) _Context.Handler, view_states, control_states, sizes);
-#else
-				data.AddControlTree ((Page) _Context.Handler, view_states, sizes);
-#endif
 
 			AddCookies ();
 			AddHeaders ();
@@ -179,14 +169,12 @@ namespace System.Web {
 			view_states [ctrl] = vs;
 		}
 
-#if NET_2_0
 		internal void SaveControlState (Control ctrl, object vs) {
 			if (control_states == null)
 				control_states = new Hashtable ();
 
 			control_states [ctrl] = vs;
 		}
-#endif
 
 		internal void SaveSize (Control ctrl, int size)
 		{

+ 1 - 5
mcs/class/System.Web/System.Web/TraceContextEventArgs.cs

@@ -4,7 +4,7 @@
 // Author:
 //	Sebastien Pouliot  <[email protected]>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -26,8 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System.Collections;
 using System.Security.Permissions;
 
@@ -49,5 +47,3 @@ namespace System.Web {
 		}
 	}
 }
-
-#endif

+ 3 - 7
mcs/class/System.Web/System.Web/TraceContextEventHandler.cs

@@ -4,7 +4,7 @@
 // Author:
 //	Sebastien Pouliot  <[email protected]>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -26,11 +26,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
-namespace System.Web {
-
+namespace System.Web 
+{
 	public delegate void TraceContextEventHandler (object sender, TraceContextEventArgs e);
 }
-
-#endif

+ 0 - 2
mcs/class/System.Web/System.Web/TraceContextRecord.cs

@@ -26,7 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System;
 using System.Security.Permissions;
 using System.Text;
@@ -75,4 +74,3 @@ namespace System.Web
 		}
 	}
 }
-#endif

+ 10 - 91
mcs/class/System.Web/System.Web/TraceData.cs

@@ -4,7 +4,7 @@
 // Author(s):
 //  Jackson Harper ([email protected])
 //
-// (C) 2004 Novell, Inc (http://www.novell.com)
+// (C) 2004-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -31,19 +31,16 @@
 
 using System;
 using System.Collections;
+using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
 using System.Text;
 using System.Web.UI;
 using System.Web.UI.WebControls;
 
-#if NET_2_0
-using System.Collections.Generic;
-#endif
-
-namespace System.Web {
-
-	class InfoTraceData
+namespace System.Web
+{
+	sealed class InfoTraceData
 	{
 		public string Category;
 		public string Message;
@@ -63,35 +60,27 @@ namespace System.Web {
 		}
 	}
 
-	class ControlTraceData
+	sealed class ControlTraceData
 	{
 		public string ControlId;
 		public Type Type;
 		public int RenderSize;
 		public int ViewstateSize;
 		public int Depth;
-#if NET_2_0
 		public int ControlstateSize;
-#endif
 
-#if NET_2_0
 		public ControlTraceData (string controlId, Type type, int renderSize, int viewstateSize, int controlstateSize, int depth)
-#else
-		public ControlTraceData (string controlId, Type type, int renderSize, int viewstateSize, int depth)
-#endif
 		{
 			this.ControlId = controlId;
 			this.Type = type;
 			this.RenderSize = renderSize;
 			this.ViewstateSize = viewstateSize;
 			this.Depth = depth;
-#if NET_2_0
 			this.ControlstateSize = controlstateSize;
-#endif
 		}
 	}
 
-	class NameValueTraceData
+	sealed class NameValueTraceData
 	{
 		public string Name;
 		public string Value;
@@ -103,28 +92,17 @@ namespace System.Web {
 		}
 	}
 	
-	internal class TraceData {
-
+	sealed class TraceData
+	{
 		bool is_first_time;
 		DateTime first_time;
 		double prev_time;
-
-#if NET_2_0
 		Queue <InfoTraceData> info;
 		Queue <ControlTraceData> control_data;
 		Queue <NameValueTraceData> cookie_data;
 		Queue <NameValueTraceData> header_data;
 		Queue <NameValueTraceData> servervar_data;
 		Hashtable ctrl_cs;
-#else
-		Queue info;
-		Queue control_data;
-		Queue cookie_data;
-		Queue header_data;
-		Queue servervar_data;
-		//DataTable viewstate_data;
-#endif
-		
 		string request_path;
 		string session_id;
 		DateTime request_time;
@@ -137,19 +115,11 @@ namespace System.Web {
 
 		public TraceData ()
 		{
-#if NET_2_0
 			info = new Queue <InfoTraceData> ();
 			control_data = new Queue <ControlTraceData> ();
 			cookie_data = new Queue <NameValueTraceData> ();
 			header_data = new Queue <NameValueTraceData> ();
 			servervar_data = new Queue <NameValueTraceData> ();
-#else
-			info = new Queue ();
-			control_data = new Queue ();
-			cookie_data = new Queue ();
-			header_data = new Queue ();
-			servervar_data = new Queue ();
-#endif
 
 			/* TODO
 			viewstate_data = new DataTable ();
@@ -236,18 +206,12 @@ namespace System.Web {
 			return res.Replace (" ", "&nbsp;");
 		}
 		
-#if NET_2_0
 		public void AddControlTree (Page page, Hashtable ctrl_vs, Hashtable ctrl_cs, Hashtable sizes)
-#else
-		public void AddControlTree (Page page, Hashtable ctrl_vs, Hashtable sizes)
-#endif
 		{
 			this.page = page;
 			this.ctrl_vs = ctrl_vs;
 			this.sizes = sizes;
-#if NET_2_0
 			this.ctrl_cs = ctrl_cs;
-#endif
 			AddControl (page, 0);
 		}
 
@@ -261,9 +225,7 @@ namespace System.Web {
 					c.GetType (),
 					GetRenderSize (c),
 					GetViewStateSize (c, (ctrl_vs != null) ? ctrl_vs [c] : null),
-#if NET_2_0
 					GetViewStateSize (c, (ctrl_cs != null) ? ctrl_cs [c] : null),
-#endif
 					control_pos));
 			
 			if (c.HasControls ()) {
@@ -350,7 +312,6 @@ namespace System.Web {
 			table.Rows.Add (SubHeadRow ("Category", "Message", "From First(s)", "From Lasts(s)"));
 			
 			int pos = 0;
-#if NET_2_0
 			IEnumerable<InfoTraceData> enumerable = info;
 
 			if (TraceMode == TraceMode.SortByCategory) {
@@ -361,10 +322,6 @@ namespace System.Web {
 
 			foreach (InfoTraceData i in enumerable)
 				RenderTraceInfoRow (table, i, pos++);
-#else
-			foreach (object o in info)
-				RenderTraceInfoRow (table, o as InfoTraceData, pos++);
-#endif
 			table.RenderControl (output);
 		}
 		
@@ -382,19 +339,12 @@ namespace System.Web {
 						String.Format ("ViewState Size (total: {0} bytes)(excluding children)",
 								page_vs_size)
 #endif
-#if NET_2_0
 						,"ControlState Size (excluding children)"
-#endif
 							));
 			
 			int pos = 0;
-#if NET_2_0
 			foreach (ControlTraceData r in control_data)
 				RenderControlTraceDataRow (table, r, pos++);
-#else
-			foreach (object o in control_data)
-				RenderControlTraceDataRow (table, o as ControlTraceData, pos++);
-#endif
 			table.RenderControl (output);
 		}
 
@@ -409,11 +359,7 @@ namespace System.Web {
 				prefix += "&nbsp;&nbsp;&nbsp;&nbsp;";
 			RenderAltRow (table, pos, prefix + r.ControlId,
 				      r.Type.ToString (), r.RenderSize.ToString (),
-#if NET_2_0
-					  r.ViewstateSize.ToString (), r.ControlstateSize.ToString ());
-#else
-				      r.ViewstateSize.ToString ());
-#endif
+				      r.ViewstateSize.ToString (), r.ControlstateSize.ToString ());
 		}
 		
 		void RenderCookies (HtmlTextWriter output)
@@ -424,13 +370,8 @@ namespace System.Web {
 			table.Rows.Add (SubHeadRow ("Name", "Value", "Size"));
 			
 			int pos = 0;
-#if NET_2_0
 			foreach (NameValueTraceData r in cookie_data)
 				RenderCookieDataRow (table, r, pos++);
-#else
-			foreach (object o in cookie_data)
-				RenderCookieDataRow (table, o as NameValueTraceData, pos++);
-#endif		
 			
 			table.RenderControl (output);
 		}
@@ -452,19 +393,8 @@ namespace System.Web {
 			table.Rows.Add (SubHeadRow ("Name", "Value"));
 			
 			int pos = 0;
-#if NET_2_0
 			foreach (NameValueTraceData r in header_data)
 				RenderAltRow (table, pos++, r.Name, r.Value);
-#else
-			NameValueTraceData r;
-			foreach (object o in header_data) {
-				r = o as NameValueTraceData;
-				if (r == null)
-					continue;
-				
-				RenderAltRow (table, pos++, r.Name, r.Value);
-			}
-#endif
 			table.RenderControl (output);
 		}
 		
@@ -476,19 +406,8 @@ namespace System.Web {
 			table.Rows.Add (SubHeadRow ("Name", "Value"));
 			
 			int pos = 0;
-#if NET_2_0
 			foreach (NameValueTraceData r in servervar_data)
 				RenderAltRow (table, pos++, r.Name, r.Value);
-#else
-			NameValueTraceData r;
-			foreach (object o in servervar_data) {
-				r = o as NameValueTraceData;
-				if (r == null)
-					continue;
-				
-				RenderAltRow (table, pos++, r.Name, r.Value);
-			}
-#endif			
 			table.RenderControl (output);
 		}
 

+ 5 - 15
mcs/class/System.Web/System.Web/TraceManager.cs

@@ -4,7 +4,7 @@
 // Author(s):
 //  Jackson Harper ([email protected])
 //
-// (C) 2004 Novell, Inc (http://www.novell.com)
+// (C) 2004-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -33,12 +33,10 @@ using System;
 using System.Collections;
 using System.Web.Configuration;
 
-namespace System.Web {
-
-	internal class TraceManager {
-#if !NET_2_0
-		static string traceConfigPath = "system.web/trace";
-#endif
+namespace System.Web
+{
+	sealed class TraceManager
+	{
 		bool enabled = false;
 		bool local_only = true;
 		bool page_output = false;
@@ -53,14 +51,10 @@ namespace System.Web {
 		public TraceManager ()
 		{
 			try {
-#if NET_2_0
 				mode = TraceMode.SortByTime;
 				TraceSection config = WebConfigurationManager.GetWebApplicationSection ("system.web/trace") as TraceSection;
 				if (config == null)
 					config = new TraceSection ();
-#else
-				TraceConfig config = (TraceConfig) HttpContext.GetAppConfig (traceConfigPath);
-#endif
 
 				if (config == null)
 					return;
@@ -68,14 +62,10 @@ namespace System.Web {
 				enabled = config.Enabled;
 				local_only = config.LocalOnly;
 				page_output = config.PageOutput;
-#if NET_2_0
 				if (config.TraceMode == TraceDisplayMode.SortByTime)
 					mode = TraceMode.SortByTime;
 				else
 					mode = TraceMode.SortByCategory;
-#else
-				mode = config.TraceMode;
-#endif
 				request_limit = config.RequestLimit;
 			} catch (Exception ex) {
 				initialException = ex;

+ 3 - 3
mcs/class/System.Web/System.Web/VirtualPath.cs

@@ -4,7 +4,7 @@
 // Authors:
 //   Marek Habersack ([email protected])
 //
-// (C) 2008 Novell, Inc
+// (C) 2008-2009 Novell, Inc
 //
 
 //
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System.IO;
 using System.Web.Compilation;
 using System.Web.Util;
@@ -265,4 +265,4 @@ namespace System.Web
 		}
 	}
 }
-#endif
+

+ 2 - 8
mcs/class/System.Web/System.Web/VirtualPathUtility.cs

@@ -37,12 +37,8 @@ using Microsoft.Win32;
 
 namespace System.Web {
 
-#if NET_2_0
-	public
-#endif
-	static class VirtualPathUtility
+	public static class VirtualPathUtility
 	{
-#if NET_2_0
 		static bool monoSettingsVerifyCompatibility;
 		static bool runningOnWindows;
 		
@@ -57,7 +53,6 @@ namespace System.Web {
 				// ignore
 			}
 		}
-#endif
 		
 		public static string AppendTrailingSlash (string virtualPath)
 		{
@@ -482,7 +477,6 @@ namespace System.Web {
 			if (path == null)
 				return false;
 
-#if NET_2_0
 			bool doValidate = true;
 			if (runningOnWindows) {
 				try {
@@ -499,7 +493,7 @@ namespace System.Web {
 
 			if (!doValidate)
 				return true;
-#endif
+
 			return path.IndexOfAny (invalidVirtualPathChars) == -1;
 		}
 	}

+ 0 - 2
mcs/class/System.Web/System.Web/WebPageTraceListener.cs

@@ -26,7 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
@@ -89,4 +88,3 @@ namespace System.Web
 		}
 	}
 }
-#endif

+ 2 - 3
mcs/class/System.Web/System.Web/WebROCollection.cs

@@ -4,7 +4,7 @@
 // Authors:
 //   	Gonzalo Paniagua Javier ([email protected])
 //
-// (c) 2005 Novell, Inc. (http://www.novell.com)
+// (c) 2005-2009 Novell, Inc. (http://www.novell.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining
@@ -35,9 +35,8 @@ namespace System.Web
 	{
 		bool got_id;
 		int id;
-#if NET_2_0
+
 		public WebROCollection () : base (StringComparer.OrdinalIgnoreCase) { }
-#endif
 		public bool GotID {
 			get { return got_id; }
 		}

+ 0 - 2
mcs/class/System.Web/System.Web/XmlSiteMapProvider.cs

@@ -31,7 +31,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Specialized;
@@ -527,5 +526,4 @@ namespace System.Web
 	}
 
 }
-#endif