mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
* System.Web/HttpApplication.cs: set culture/uiculture from configuration and restore it after each step. Fixes bug #52851. * System.Web.Configuration/GlobalizationConfiguration.cs: if we have no context, use GetAppConfig instead of GetConfig. svn path=/trunk/mcs/; revision=28081
56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
//
|
|
// System.Web.Configuration.GlobalizationConfiguration
|
|
//
|
|
// Authors:
|
|
// Patrik Torstensson ([email protected])
|
|
// Gonzalo Paniagua Javier ([email protected])
|
|
//
|
|
// (c) 2003 Ximian, Inc. (http://www.ximian.com)
|
|
//
|
|
|
|
using System.Globalization;
|
|
using System.Text;
|
|
|
|
namespace System.Web.Configuration
|
|
{
|
|
class GlobalizationConfiguration
|
|
{
|
|
internal Encoding RequestEncoding;
|
|
internal Encoding ResponseEncoding;
|
|
internal Encoding FileEncoding;
|
|
internal CultureInfo Culture;
|
|
internal CultureInfo UICulture;
|
|
|
|
internal GlobalizationConfiguration (object p)
|
|
{
|
|
if (!(p is GlobalizationConfiguration))
|
|
return;
|
|
|
|
GlobalizationConfiguration parent = (GlobalizationConfiguration) p;
|
|
RequestEncoding = parent.RequestEncoding;
|
|
ResponseEncoding = parent.ResponseEncoding;
|
|
FileEncoding = parent.FileEncoding;
|
|
Culture = parent.Culture;
|
|
UICulture = parent.UICulture;
|
|
}
|
|
|
|
static public GlobalizationConfiguration GetInstance (HttpContext context)
|
|
{
|
|
GlobalizationConfiguration config;
|
|
try {
|
|
if (context == null)
|
|
config = HttpContext.GetAppConfig ("system.web/globalization")
|
|
as GlobalizationConfiguration;
|
|
else
|
|
config = context.GetConfig ("system.web/globalization")
|
|
as GlobalizationConfiguration;
|
|
} catch {
|
|
return null;
|
|
}
|
|
return config;
|
|
}
|
|
|
|
}
|
|
}
|
|
|