importing messaging-2008 branch to trunk.
[mono.git] / mcs / class / System.Web / System.Web.UI.HtmlControls / HtmlTableRow.cs
index 8c3721717f0230ac1f5aeff66d46e66df277d0db..b58ce168181c1346aee37bba4b397e64a9905729 100644 (file)
@@ -35,14 +35,10 @@ namespace System.Web.UI.HtmlControls {
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        // attributes
-#if NET_2_0
-       [ParseChildren (true, "Cells", ChildControlType = typeof(Control))]
-#else  
-       [ParseChildren (true, "Cells")]
-#endif         
+       [ParseChildren (true, "Cells")] 
        public class HtmlTableRow : HtmlContainerControl {
 
-               private HtmlTableCellCollection _cells;
+               HtmlTableCellCollection _cells;
 
 
                public HtmlTableRow ()
@@ -104,12 +100,7 @@ namespace System.Web.UI.HtmlControls {
 
                [Browsable (false)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-#if NET_2_0
-               public virtual
-#else          
-               public
-#endif         
-               HtmlTableCellCollection Cells {
+               public virtual HtmlTableCellCollection Cells {
                        get {
                                if (_cells == null)
                                        _cells = new HtmlTableCellCollection (this);
@@ -161,7 +152,7 @@ namespace System.Web.UI.HtmlControls {
                        }
                }
 
-               private int Count {
+               int Count {
                        get { return (_cells == null) ? 0 : _cells.Count; }
                }
 
@@ -178,13 +169,9 @@ namespace System.Web.UI.HtmlControls {
 #endif         
                override void RenderChildren (HtmlTextWriter writer)
                {
-                       int n = Count;
-                       if (n > 0) {
+                       if (HasControls ()) {
                                writer.Indent++;
-                               for (int i=0; i < n; i++) {
-                                       writer.WriteLine ();
-                                       _cells [i].RenderControl (writer);
-                               }
+                               base.RenderChildren (writer);
                                writer.Indent--;
                                writer.WriteLine ();
                        }