From ecd1522dce709837ec4b168a3fffadc666aeddd2 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Fri, 22 Dec 2006 01:20:34 +0000 Subject: [PATCH] two methods implemented svn path=/trunk/mcs/; revision=69921 --- mcs/class/System.Web/System.Web.Hosting/ChangeLog | 4 ++++ .../System.Web.Hosting/HostingEnvironment.cs | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mcs/class/System.Web/System.Web.Hosting/ChangeLog b/mcs/class/System.Web/System.Web.Hosting/ChangeLog index 5f82d7b86ab..220f4527679 100644 --- a/mcs/class/System.Web/System.Web.Hosting/ChangeLog +++ b/mcs/class/System.Web/System.Web.Hosting/ChangeLog @@ -1,3 +1,7 @@ +2006-12-22 Marek Habersack + + * HostingEnvironment.cs: implemented the SetCultures methods. + 2006-12-19 Igor Zelmanovich * ServletWorkerRequest.cs: fixed: diff --git a/mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs b/mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs index 0eae5c8b133..fb5a18d2661 100644 --- a/mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs +++ b/mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs @@ -32,8 +32,10 @@ #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) -- 2.25.1