1 /* header comment goes here */
4 using System.Configuration;
10 namespace System.Web.Configuration {
12 public sealed class GlobalizationSection : ConfigurationSection
14 static ConfigurationProperty cultureProp;
15 static ConfigurationProperty enableBestFitResponseEncodingProp;
16 static ConfigurationProperty enableClientBasedCultureProp;
17 static ConfigurationProperty fileEncodingProp;
18 static ConfigurationProperty requestEncodingProp;
19 static ConfigurationProperty resourceProviderFactoryTypeProp;
20 static ConfigurationProperty responseEncodingProp;
21 static ConfigurationProperty responseHeaderEncodingProp;
22 static ConfigurationProperty uiCultureProp;
23 static ConfigurationPropertyCollection properties;
25 static GlobalizationSection ()
27 cultureProp = new ConfigurationProperty ("culture", typeof (string), "");
28 enableBestFitResponseEncodingProp = new ConfigurationProperty ("enableBestFitResponseEncoding", typeof (bool), false);
29 enableClientBasedCultureProp = new ConfigurationProperty ("enableClientBasedCulture", typeof (bool), false);
30 fileEncodingProp = new ConfigurationProperty ("fileEncoding", typeof (Encoding));
31 requestEncodingProp = new ConfigurationProperty ("requestEncoding", typeof (Encoding), Encoding.UTF8);
32 resourceProviderFactoryTypeProp = new ConfigurationProperty ("resourceProviderFactoryType", typeof (string), "");
33 responseEncodingProp = new ConfigurationProperty ("responseEncoding", typeof (Encoding), Encoding.UTF8);
34 responseHeaderEncodingProp = new ConfigurationProperty ("responseHeaderEncoding", typeof (Encoding), Encoding.UTF8);
35 uiCultureProp = new ConfigurationProperty ("uiCulture", typeof (string), "");
36 properties = new ConfigurationPropertyCollection ();
38 properties.Add (cultureProp);
39 properties.Add (enableBestFitResponseEncodingProp);
40 properties.Add (enableClientBasedCultureProp);
41 properties.Add (fileEncodingProp);
42 properties.Add (requestEncodingProp);
43 properties.Add (resourceProviderFactoryTypeProp);
44 properties.Add (responseEncodingProp);
45 properties.Add (responseHeaderEncodingProp);
46 properties.Add (uiCultureProp);
50 protected override void PostDeserialize ()
52 base.PostDeserialize();
56 protected override void PreSerialize (XmlWriter writer)
58 base.PostDeserialize();
61 [ConfigurationProperty ("culture", DefaultValue = "")]
62 public string Culture {
63 get { return (string) base [cultureProp];}
64 set { base[cultureProp] = value; }
67 [ConfigurationProperty ("enableBestFitResponseEncoding", DefaultValue = "False")]
68 public bool EnableBestFitResponseEncoding {
69 get { return (bool) base [enableBestFitResponseEncodingProp];}
70 set { base[enableBestFitResponseEncodingProp] = value; }
73 [ConfigurationProperty ("enableClientBasedCulture", DefaultValue = "False")]
74 public bool EnableClientBasedCulture {
75 get { return (bool) base [enableClientBasedCultureProp];}
76 set { base[enableClientBasedCultureProp] = value; }
79 [ConfigurationProperty ("fileEncoding")]
80 public Encoding FileEncoding {
81 get { return (Encoding) base [fileEncodingProp];}
82 set { base[fileEncodingProp] = value; }
85 [ConfigurationProperty ("requestEncoding", DefaultValue = "utf-8")]
86 public Encoding RequestEncoding {
87 get { return (Encoding) base [requestEncodingProp];}
88 set { base[requestEncodingProp] = value; }
91 [ConfigurationProperty ("resourceProviderFactoryType", DefaultValue = "")]
92 public string ResourceProviderFactoryType {
93 get { return (string) base [resourceProviderFactoryTypeProp];}
94 set { base[resourceProviderFactoryTypeProp] = value; }
97 [ConfigurationProperty ("responseEncoding", DefaultValue = "utf-8")]
98 public Encoding ResponseEncoding {
99 get { return (Encoding) base [responseEncodingProp];}
100 set { base[responseEncodingProp] = value; }
103 [ConfigurationProperty ("responseHeaderEncoding", DefaultValue = "utf-8")]
104 public Encoding ResponseHeaderEncoding {
105 get { return (Encoding) base [responseHeaderEncodingProp];}
106 set { base[responseHeaderEncodingProp] = value; }
109 [ConfigurationProperty ("uiCulture", DefaultValue = "")]
110 public string UICulture {
111 get { return (string) base [uiCultureProp];}
112 set { base[uiCultureProp] = value; }
115 protected override ConfigurationPropertyCollection Properties {
116 get { return properties; }