2005-11-28 Chris Toshok <toshok@ximian.com>
authorChris Toshok <toshok@novell.com>
Mon, 28 Nov 2005 20:54:41 +0000 (20:54 -0000)
committerChris Toshok <toshok@novell.com>
Mon, 28 Nov 2005 20:54:41 +0000 (20:54 -0000)
* Page.cs (GetFormatter): CONFIGURATION_2_0 work.

* TemplateParser.cs (..ctor): CONFIGURATION_2_0 work.
(PagesConfig): add a CONFIGURATION_2_0 version that returns a
PagesSection.

* PageParser.cs (ProcessMainAttributes): CONFIGURATION_2_0 work.

* BaseParser.cs (CompilationConfig): add a CONFIGURATION_2_0
version that returns a CompilationSection.

svn path=/trunk/mcs/; revision=53582

mcs/class/System.Web/System.Web.UI/BaseParser.cs
mcs/class/System.Web/System.Web.UI/ChangeLog
mcs/class/System.Web/System.Web.UI/Page.cs
mcs/class/System.Web/System.Web.UI/PageParser.cs
mcs/class/System.Web/System.Web.UI/TemplateParser.cs

index e08281f53bc0b4ace4e74c53d268ff18572211ab..c005694355cbaaea9082f78c8652102db4724df8 100644 (file)
@@ -46,7 +46,11 @@ namespace System.Web.UI
                string baseDir;
                string baseVDir;
                ILocation location;
+#if CONFIGURATION_2_0
+               CompilationSection compilationConfig;
+#else
                CompilationConfiguration compilationConfig;
+#endif
 
                internal string MapPath (string path)
                {
@@ -136,6 +140,14 @@ namespace System.Web.UI
                        set { baseVDir = value; }
                }
 
+#if CONFIGURATION_2_0
+               internal CompilationSection CompilationConfig {
+                       get {
+                               return WebConfigurationManager.GetSection ("system.web/compilation") as CompilationSection;
+                       }
+               }
+
+#else
                internal CompilationConfiguration CompilationConfig {
                        get {
                                if (compilationConfig == null)
@@ -144,6 +156,7 @@ namespace System.Web.UI
                                return compilationConfig;
                        }
                }
+#endif
        }
 }
 
index 5ebe185883b007f689b623217c761a79bd94eabf..cdde65ff210718efccf4e230fa193c810bb96da5 100644 (file)
@@ -1,3 +1,16 @@
+2005-11-28  Chris Toshok  <toshok@ximian.com>
+
+       * Page.cs (GetFormatter): CONFIGURATION_2_0 work.
+
+       * TemplateParser.cs (..ctor): CONFIGURATION_2_0 work.
+       (PagesConfig): add a CONFIGURATION_2_0 version that returns a
+       PagesSection.
+
+       * PageParser.cs (ProcessMainAttributes): CONFIGURATION_2_0 work.
+
+       * BaseParser.cs (CompilationConfig): add a CONFIGURATION_2_0
+       version that returns a CompilationSection.
+
 2005-11-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * SimpleWebHandlerParser.cs: removed 'codebehind' related stuff.
index 64c237d627c9dc52723bb9d7640b78a6228d559e..00c268a2fc3d3c8bedfe5b5a50f67e17c9ae629a 100644 (file)
@@ -778,12 +778,20 @@ public class Page : TemplateControl, IHttpHandler
 
        LosFormatter GetFormatter ()
        {
+#if CONFIGURATION_2_0
+               PagesSection config = (PagesSection) WebConfigurationManager.GetWebApplicationSection ("system.web/pages");
+#else
                PagesConfiguration config = PagesConfiguration.GetInstance (_context);
+#endif
                byte [] vkey = null;
                if (config.EnableViewStateMac) {
-                       MachineKeyConfig mconfig;
-                       mconfig = HttpContext.GetAppConfig ("system.web/machineKey") as MachineKeyConfig;
+#if CONFIGURATION_2_0
+                       MachineKeySection mconfig = (MachineKeySection) WebConfigurationManager.GetWebApplicationSection ("system.web/machineKey");
+                       vkey = mconfig.ValidationKeyBytes;
+#else
+                       MachineKeyConfig mconfig = HttpContext.GetAppConfig ("system.web/machineKey") as MachineKeyConfig;
                        vkey = mconfig.ValidationKey;
+#endif
                }
 
                return new LosFormatter (config.EnableViewStateMac, vkey);
index b1574d476b3d5f0662f88bd60a9a7dd1d0e1d5a1..7a15503b073040e457e44cebc4905b92195379bc 100644 (file)
@@ -88,7 +88,13 @@ namespace System.Web.UI
 
                internal override void ProcessMainAttributes (Hashtable atts)
                {
-                       string enabless = GetString (atts, "EnableSessionState", PagesConfig.EnableSessionState);
+                       string enabless = GetString (atts, "EnableSessionState",
+#if CONFIGURATION_2_0
+                                                    PagesConfig.EnableSessionState.ToString()
+#else
+                                                    PagesConfig.EnableSessionState
+#endif
+                                                    );
                        if (enabless != null) {
                                readonlySessionState = (String.Compare (enabless, "readonly", true) == 0);
                                if (readonlySessionState == true || String.Compare (enabless, "true", true) == 0) {
index 8a82aca3bbfad06f20414100410a2327c214b2dd..b86efda451b4dfebbc0e08f2ee7b43123e01e86d 100644 (file)
@@ -69,7 +69,8 @@ namespace System.Web.UI {
                OutputCacheLocation oc_location;
                Assembly srcAssembly;
                int appAssemblyIndex = -1;
-                
+
+               [MonoTODO ("deal with AddAssembliesInBin in the 2.0 case")]
                internal TemplateParser ()
                {
                        imports = new ArrayList ();
@@ -88,10 +89,15 @@ namespace System.Web.UI {
                        imports.Add ("System.Web.UI.HtmlControls");
 
                        assemblies = new ArrayList ();
+#if CONFIGURATION_2_0
+                       foreach (AssemblyInfo info in CompilationConfig.Assemblies)
+                               AddAssemblyByName (info.Assembly);
+#else
                        foreach (string a in CompilationConfig.Assemblies)
                                AddAssemblyByName (a);
                        if (CompilationConfig.AssembliesInBin)
                                AddAssembliesInBin ();
+#endif
 
                        language = CompilationConfig.DefaultLanguage;
                }
@@ -635,9 +641,17 @@ namespace System.Web.UI {
                        get { return oc_param; }
                }
 
+#if CONFIGURATION_2_0
+               internal PagesSection PagesConfig {
+                       get {
+                               return WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;
+                       }
+               }
+#else
                internal PagesConfiguration PagesConfig {
                        get { return PagesConfiguration.GetInstance (Context); }
                }
+#endif
        }
 }