two methods implemented
authorMarek Habersack <grendel@twistedcode.net>
Fri, 22 Dec 2006 01:20:34 +0000 (01:20 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Fri, 22 Dec 2006 01:20:34 +0000 (01:20 -0000)
svn path=/trunk/mcs/; revision=69921

mcs/class/System.Web/System.Web.Hosting/ChangeLog
mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs

index 5f82d7b86ab7a03ec3dd28192f449f7f7f9ffae4..220f4527679f5f91d992bb0a4a2e8725f3e644c8 100644 (file)
@@ -1,3 +1,7 @@
+2006-12-22  Marek Habersack  <grendello@gmail.com>
+
+       * HostingEnvironment.cs: implemented the SetCultures methods.
+
 2006-12-19 Igor Zelmanovich <igorz@mainsoft.com>
 
        * ServletWorkerRequest.cs: fixed:
index 0eae5c8b133091bb013cf1f3cebc412b4474e799..fb5a18d266122267ce4de58e52429569d211169c 100644 (file)
 #if NET_2_0
 
 using System;
+using System.Globalization;
 using System.Security.Permissions;
 using System.Threading;
+using System.Web.Configuration;
 using System.Web.Caching;
 using System.Web.Util;
 
@@ -168,16 +170,20 @@ namespace System.Web.Hosting {
                        vpath_provider = virtualPathProvider;
                }
                
-               [MonoTODO ("Not implemented")]
                public static IDisposable SetCultures (string virtualPath)
                {
-                       throw new NotImplementedException ();
+                       GlobalizationSection gs = WebConfigurationManager.GetSection ("system.web/globalization", virtualPath) as GlobalizationSection;
+                       IDisposable ret = Thread.CurrentThread.CurrentCulture as IDisposable;
+                       string culture = gs.Culture;
+                       if (String.IsNullOrEmpty (culture))
+                               return ret;
+                       Thread.CurrentThread.CurrentCulture = new CultureInfo (culture);
+                       return ret;
                }
 
-               [MonoTODO ("Not implemented")]
                public static IDisposable SetCultures ()
                {
-                       throw new NotImplementedException ();
+                       return SetCultures ("~/");
                }
 
                public static void UnregisterObject (IRegisteredObject obj)