Author: mhabersack
Date: 2007-07-18 08:48:55 -0400 (Wed, 18 Jul 2007)
New Revision: 82200

Modified:
   trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
   trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
   trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs
Log:
2007-07-18  Marek Habersack  <[EMAIL PROTECTED]>

        * ControlBuilder.cs: on the 2.0 profile BindingContainerType
        returns the associated control's base type when parent builder is
        absent instead of typeof (Control). It returns typeof (Control) if
        the parent builder type is determined to be a
        NamingContainer. This makes the generated code match the MS.NET
        output. Fixes bug #82119.

2007-07-18  Marek Habersack  <[EMAIL PROTECTED]>

        * TemplateControlCompiler.cs: on the 2.0 profile, GetContainerType
        does not look up the Item/Items properties to determine the
        container type, instead it just returns the type reported by the
        builder passed to this method. This change makes the generated
        code match MS.NET. Fixes bug #82119.



Modified: trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2007-07-18 
12:31:21 UTC (rev 82199)
+++ trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2007-07-18 
12:48:55 UTC (rev 82200)
@@ -1,3 +1,11 @@
+2007-07-18  Marek Habersack  <[EMAIL PROTECTED]>
+
+       * TemplateControlCompiler.cs: on the 2.0 profile, GetContainerType
+       does not look up the Item/Items properties to determine the
+       container type, instead it just returns the type reported by the
+       builder passed to this method. This change makes the generated
+       code match MS.NET. Fixes bug #82119.
+
 2007-07-02  Marek Habersack  <[EMAIL PROTECTED]>
 
        * TemplateControlCompiler.cs: don't use StartWith to see if a

Modified: 
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs    
    2007-07-18 12:31:21 UTC (rev 82199)
+++ 
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs    
    2007-07-18 12:48:55 UTC (rev 82200)
@@ -435,9 +435,8 @@
                                }
                        }
 #endif
-
                        method = CreateDBMethod (dbMethodName, GetContainerType 
(builder), builder.ControlType);
-
+                       
                        CodeVariableReferenceExpression targetExpr = new 
CodeVariableReferenceExpression ("target");
 
                        // This should be a CodePropertyReferenceExpression for 
properties... but it works anyway
@@ -1149,7 +1148,9 @@
                        TemplateBuilder tb = builder as TemplateBuilder;
                        if (tb != null && tb.ContainerType != null)
                                return tb.ContainerType;
-
+#if NET_2_0
+                       return builder.BindingContainerType;
+#else
                        Type type = builder.BindingContainerType;
 
                        PropertyInfo prop = type.GetProperty ("Items", 
noCaseFlags & ~BindingFlags.NonPublic);
@@ -1165,6 +1166,7 @@
                                return type;
 
                        return prop.PropertyType;
+#endif
                }
                
                CodeMemberMethod CreateDBMethod (string name, Type container, 
Type target)

Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2007-07-18 12:31:21 UTC 
(rev 82199)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2007-07-18 12:48:55 UTC 
(rev 82200)
@@ -1,3 +1,12 @@
+2007-07-18  Marek Habersack  <[EMAIL PROTECTED]>
+
+       * ControlBuilder.cs: on the 2.0 profile BindingContainerType
+       returns the associated control's base type when parent builder is
+       absent instead of typeof (Control). It returns typeof (Control) if
+       the parent builder type is determined to be a
+       NamingContainer. This makes the generated code match the MS.NET
+       output. Fixes bug #82119.
+
 2007-07-18 Igor Zelmanovich <[EMAIL PROTECTED]>
 
        * Page.cs:

Modified: trunk/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs  2007-07-18 
12:31:21 UTC (rev 82199)
+++ trunk/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs  2007-07-18 
12:48:55 UTC (rev 82200)
@@ -180,21 +180,32 @@
                internal
 #endif
                Type BindingContainerType {
-                       get {
-                               if (parentBuilder == null)
+                       get {                           
+                               if (parentBuilder == null) {
+#if NET_2_0
+                                       Type bt = Parser.BaseType;
+                                       if (bt != null)
+                                               return bt;
+#endif
+
                                        return typeof (Control);
-                                       
+                               }
+
                                if (parentBuilder is TemplateBuilder && 
((TemplateBuilder)parentBuilder).ContainerType != null)
                                        return 
((TemplateBuilder)parentBuilder).ContainerType;
-
+                               
                                Type ptype = parentBuilder.ControlType;
                                if (ptype == null)
                                        return 
parentBuilder.BindingContainerType;
-
+                               
                                if (!typeof (INamingContainer).IsAssignableFrom 
(ptype))
                                        return 
parentBuilder.BindingContainerType;
 
+#if NET_2_0
+                               return typeof (Control);
+#else
                                return ptype;
+#endif
                        }
                }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to