mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
* System.Web.dll.sources: added WebConfigurationSettings. * System.Web/HttpContext.cs: updated GetConfig and GetAppConfig to new API. * System.Web/HttpResponse.cs: separate initialization of the HttpWriter, as it tries to read configuration settings while the config. system is not available (ie, before the first request). * System.Web/HttpRuntime.cs: delayed queueManager and response writer initialization until the configuration system is working. * System.Web.Configuration/GlobalizationConfiguration.cs: return null when the configuration is not available. * System.Web.Util/WebEncoding.cs: use the Default encoding when the globalization configuration is not available. * System.Web.Configuration/WebConfigurationSettings.cs: handle configuration for System.Web. It replaces the default IConfigurationSystem with itself and handles web.config files oddities. * System.Web.UI.WebControls/WebControl.cs: don't create the attributes when GetAttribute is called. svn path=/trunk/mcs/; revision=20681
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;
|
|
if (context == null)
|
|
context = HttpContext.Context;
|
|
|
|
//config = context.GetConfig ("system.web/globalization") as GlobalizationConfiguration;
|
|
try {
|
|
config = HttpContext.GetAppConfig ("system.web/globalization")
|
|
as GlobalizationConfiguration;
|
|
} catch {
|
|
return null;
|
|
}
|
|
return config;
|
|
}
|
|
|
|
}
|
|
}
|
|
|