Ver código fonte

* HttpApplication.cs: refactred handlers configuration section as member of class

svn path=/trunk/mcs/; revision=74717
Vladimir Krasnov 19 anos atrás
pai
commit
ed9fa8eae1

+ 5 - 0
mcs/class/System.Web/System.Web/ChangeLog

@@ -1,3 +1,8 @@
+2007-03-21  Vladimir Krasnov  <[email protected]>
+
+	* HttpApplication.cs: refactred handlers configuration section as
+	member of class
+
 2007-03-20  Marek Habersack  <[email protected]>
 
 	* HttpRequest.cs: implement AppRelativeCurrentExecutionFilePath.

+ 10 - 3
mcs/class/System.Web/System.Web/HttpApplication.cs

@@ -137,6 +137,9 @@ namespace System.Web {
 		IPrincipal prev_user;
 #if NET_2_0
 		static Exception initialization_exception;
+		HttpHandlersSection httpHandlersSection;
+#else
+		HandlerFactoryConfiguration factory_config;
 #endif
 
 		//
@@ -187,6 +190,12 @@ namespace System.Web {
 					appui_culture = cfg.UICulture;
 				}
 #endif
+
+#if NET_2_0
+				httpHandlersSection = (HttpHandlersSection) WebConfigurationManager.GetSection ("system.web/httpHandlers");
+#else
+				factory_config = (HandlerFactoryConfiguration) HttpContext.GetAppConfig ("system.web/httpHandlers");
+#endif
 			}
 		}
 
@@ -1128,10 +1137,8 @@ namespace System.Web {
 			
 			IHttpHandler handler = null;
 #if NET_2_0
-			HttpHandlersSection section = (HttpHandlersSection) WebConfigurationManager.GetSection ("system.web/httpHandlers");
-			object o = section.LocateHandler (verb, url);
+			object o = httpHandlersSection.LocateHandler (verb, url);
 #else
-			HandlerFactoryConfiguration factory_config = (HandlerFactoryConfiguration) HttpContext.GetAppConfig ("system.web/httpHandlers");
 			object o = factory_config.LocateHandler (verb, url);
 #endif