2009-09-28 Marek Habersack <mhabersack@novell.com>
[mono.git] / mcs / class / System.Web / System.Web / HttpContext.cs
index 4006ef6d68426d62d91782718509859d7b8ddf84..5c9c093805a8c13c3f569bf7171ffd003f4a6302 100644 (file)
@@ -484,8 +484,8 @@ namespace System.Web {
                        
                        return true;
                }
-
-               internal static IResourceProvider GetResourceProvider (string key, bool isLocal)
+               
+               internal static IResourceProvider GetResourceProvider (string virtualPath, bool isLocal)
                {
                        if (!EnsureProviderFactory ())
                                return null;
@@ -493,27 +493,27 @@ namespace System.Web {
                        // TODO: check if it makes sense to cache the providers and, if yes, maybe
                        // we should expire the entries (or just store them in InternalCache?)
                        IResourceProvider rp = null;
-                       if (!resource_providers.TryGetValue (key, out rp)) {
+                       if (!resource_providers.TryGetValue (virtualPath, out rp)) {
                                if (isLocal) {
                                        HttpContext ctx = HttpContext.Current;
                                        HttpRequest req = ctx != null ? ctx.Request : null;
-                                       rp = provider_factory.CreateLocalResourceProvider (req != null ? req.Path : null);
+                                       rp = provider_factory.CreateLocalResourceProvider (virtualPath);
                                } else
-                                       rp = provider_factory.CreateGlobalResourceProvider (key);
+                                       rp = provider_factory.CreateGlobalResourceProvider (virtualPath);
                                
                                if (rp == null) {
                                        if (isLocal) {
                                                HttpContext ctx = HttpContext.Current;
                                                HttpRequest req = ctx != null ? ctx.Request : null;
-                                               rp = DefaultProviderFactory.CreateLocalResourceProvider (req != null ? req.Path : null);
+                                               rp = DefaultProviderFactory.CreateLocalResourceProvider (virtualPath);
                                        } else
-                                               rp = DefaultProviderFactory.CreateGlobalResourceProvider (key);
+                                               rp = DefaultProviderFactory.CreateGlobalResourceProvider (virtualPath);
 
                                        if (rp == null)
                                                return null;
                                }
                                
-                               resource_providers.Add (key, rp);
+                               resource_providers.Add (virtualPath, rp);
                        }
 
                        return rp;