One more changelog
[mono.git] / mcs / class / System.Web / System.Web.UI / PageParser.cs
index 3072d92fb401f433b6210366473fce94cc4424ab..0703b24f193e07baa0748c16e5afb647f4b81626 100644 (file)
@@ -35,6 +35,7 @@ using System.Text;
 using System.Web.Compilation;
 using System.Web.Configuration;
 using System.Web.Util;
+using System.IO;
 
 namespace System.Web.UI
 {
@@ -63,6 +64,9 @@ namespace System.Web.UI
                string masterPage;
                Type masterType;
                string title;
+               string theme;
+               string styleSheetTheme;
+               bool enable_event_validation;
 #endif
 
                public PageParser ()
@@ -78,6 +82,17 @@ namespace System.Web.UI
                        AddApplicationAssembly ();
                }
 
+#if NET_2_0
+               internal PageParser (string virtualPath, TextReader reader, HttpContext context)
+               {
+                       Context = context;
+                       BaseVirtualDir = UrlUtils.GetDirectory (virtualPath);
+                       Reader = reader;
+                       SetBaseType (PagesConfig.PageBaseType);
+                       AddApplicationAssembly ();
+               }
+#endif
+
                public static IHttpHandler GetCompiledPageInstance (string virtualPath,
                                                                    string inputFile, 
                                                                    HttpContext context)
@@ -86,7 +101,7 @@ namespace System.Web.UI
                        IHttpHandler h = (IHttpHandler) pp.GetCompiledInstance ();
                        return h;
                }
-
+               
                internal override void ProcessMainAttributes (Hashtable atts)
                {
                        string enabless = GetString (atts, "EnableSessionState",
@@ -176,12 +191,15 @@ namespace System.Web.UI
                                
                                CultureInfo ci = null;
                                try {
-                                       ci = new CultureInfo (culture);                                 
+#if NET_2_0
+                                       if (!culture.StartsWith ("auto"))
+#endif
+                                               ci = new CultureInfo (culture);
                                } catch {
                                        ThrowParseException ("Unsupported Culture: " + culture);
                                }
 
-                               if (ci.IsNeutralCulture) {
+                               if (ci != null && ci.IsNeutralCulture) {
                                        string suggestedCulture = SuggestCulture (culture);
                                        string fmt = "Culture attribute must be set to a non-neutral Culture.";
                                        if (suggestedCulture != null)
@@ -196,12 +214,15 @@ namespace System.Web.UI
                        if (uiculture != null) {
                                CultureInfo ci = null;
                                try {
-                                       ci = new CultureInfo (uiculture);                                       
+#if NET_2_0
+                                       if (!uiculture.StartsWith ("auto"))
+#endif
+                                               ci = new CultureInfo (uiculture);
                                } catch {
                                        ThrowParseException ("Unsupported Culture: " + uiculture);
                                }
 
-                               if (ci.IsNeutralCulture) {
+                               if (ci != null && ci.IsNeutralCulture) {
                                        string suggestedCulture = SuggestCulture (uiculture);
                                        string fmt = "UICulture attribute must be set to a non-neutral Culture.";
                                        if (suggestedCulture != null)
@@ -269,6 +290,10 @@ namespace System.Web.UI
                                MasterPageParser.GetCompiledMasterType (masterPage, MapPath (masterPage), HttpContext.Current);
 
                        title = GetString(atts, "Title", null);
+
+                       theme = GetString (atts, "Theme", null);
+                       styleSheetTheme = GetString (atts, "StyleSheetTheme", null);
+                       enable_event_validation = GetBool (atts, "EnableEventValidation", true);
 #endif
                        // Ignored by now
                        GetString (atts, "EnableViewStateMac", null);
@@ -389,6 +414,14 @@ namespace System.Web.UI
                }
 
 #if NET_2_0
+               internal string Theme {
+                       get { return theme; }
+               }
+
+               internal string StyleSheetTheme {
+                       get { return styleSheetTheme; }
+               }
+
                internal string MasterPageFile {
                        get { return masterPage; }
                }
@@ -400,6 +433,10 @@ namespace System.Web.UI
                internal string Title {
                        get { return title; }
                }
+
+               internal bool EnableEventValidation {
+                       get { return enable_event_validation; }
+               }
 #endif
        }
 }