mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 19:10:23 -10:00
54 lines
1.2 KiB
C#
54 lines
1.2 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;
|
|
if (context == null)
|
|
context = HttpContext.Context;
|
|
|
|
config = context.GetConfig ("system.web/globalization") as GlobalizationConfiguration;
|
|
|
|
if (config == null)
|
|
throw new Exception ("Configuration error");
|
|
|
|
return config;
|
|
}
|
|
|
|
}
|
|
}
|
|
|