merge -r 53370:58178
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / GlobalizationSection.cs
1 /* header comment goes here */
2
3 using System;
4 using System.Configuration;
5 using System.Text;
6 using System.Xml;
7
8 #if NET_2_0
9
10 namespace System.Web.Configuration {
11
12         public sealed class GlobalizationSection : ConfigurationSection
13         {
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;
24
25                 static GlobalizationSection ()
26                 {
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 ();
37
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);
47                 }
48
49                 [MonoTODO]
50                 protected override void PostDeserialize ()
51                 {
52                         base.PostDeserialize();
53                 }
54
55                 [MonoTODO]
56                 protected override void PreSerialize (XmlWriter writer)
57                 {
58                         base.PostDeserialize();
59                 }
60
61                 [ConfigurationProperty ("culture", DefaultValue = "")]
62                 public string Culture {
63                         get { return (string) base [cultureProp];}
64                         set { base[cultureProp] = value; }
65                 }
66
67                 [ConfigurationProperty ("enableBestFitResponseEncoding", DefaultValue = "False")]
68                 public bool EnableBestFitResponseEncoding {
69                         get { return (bool) base [enableBestFitResponseEncodingProp];}
70                         set { base[enableBestFitResponseEncodingProp] = value; }
71                 }
72
73                 [ConfigurationProperty ("enableClientBasedCulture", DefaultValue = "False")]
74                 public bool EnableClientBasedCulture {
75                         get { return (bool) base [enableClientBasedCultureProp];}
76                         set { base[enableClientBasedCultureProp] = value; }
77                 }
78
79                 [ConfigurationProperty ("fileEncoding")]
80                 public Encoding FileEncoding {
81                         get { return (Encoding) base [fileEncodingProp];}
82                         set { base[fileEncodingProp] = value; }
83                 }
84
85                 [ConfigurationProperty ("requestEncoding", DefaultValue = "utf-8")]
86                 public Encoding RequestEncoding {
87                         get { return (Encoding) base [requestEncodingProp];}
88                         set { base[requestEncodingProp] = value; }
89                 }
90
91                 [ConfigurationProperty ("resourceProviderFactoryType", DefaultValue = "")]
92                 public string ResourceProviderFactoryType {
93                         get { return (string) base [resourceProviderFactoryTypeProp];}
94                         set { base[resourceProviderFactoryTypeProp] = value; }
95                 }
96
97                 [ConfigurationProperty ("responseEncoding", DefaultValue = "utf-8")]
98                 public Encoding ResponseEncoding {
99                         get { return (Encoding) base [responseEncodingProp];}
100                         set { base[responseEncodingProp] = value; }
101                 }
102
103                 [ConfigurationProperty ("responseHeaderEncoding", DefaultValue = "utf-8")]
104                 public Encoding ResponseHeaderEncoding {
105                         get { return (Encoding) base [responseHeaderEncodingProp];}
106                         set { base[responseHeaderEncodingProp] = value; }
107                 }
108
109                 [ConfigurationProperty ("uiCulture", DefaultValue = "")]
110                 public string UICulture {
111                         get { return (string) base [uiCultureProp];}
112                         set { base[uiCultureProp] = value; }
113                 }
114
115                 protected override ConfigurationPropertyCollection Properties {
116                         get { return properties; }
117                 }
118
119         }
120
121 }
122
123 #endif
124