Merge branch 'cecil-light'
[mono.git] / mcs / class / System.Web / System.Web.UI.HtmlControls / HtmlTableRow.cs
index e13100271021e76f9e13c63fdcfce184fdd87c12..c54b3570acbff82bdeb57468f2a0c852bd10a2d9 100644 (file)
@@ -4,7 +4,7 @@
 // Author:
 //     Sebastien Pouliot  <sebastien@ximian.com>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 //
 
 using System.ComponentModel;
-
-namespace System.Web.UI.HtmlControls {
-
-#if NET_2_0
-       [ParseChildren (true, "Cells", ChildControlType = typeof(Control))]
-#else  
-       [ParseChildren (true, "Cells")]
-#endif         
-       public class HtmlTableRow : HtmlContainerControl {
-
-               private HtmlTableCellCollection _cells;
-
+using System.Security.Permissions;
+
+namespace System.Web.UI.HtmlControls
+{
+       // CAS
+       [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+       [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+       // attributes
+       [ParseChildren (true, "Cells")] 
+       public class HtmlTableRow : HtmlContainerControl
+       {
+               HtmlTableCellCollection _cells;
 
                public HtmlTableRow ()
                        : base ("tr")
                {
                }
 
-
                [DefaultValue ("")]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [WebSysDescription("")]
+               [WebCategory("Layout")]
                public string Align {
                        get {
                                string s = Attributes ["align"];
@@ -63,6 +64,8 @@ namespace System.Web.UI.HtmlControls {
 
                [DefaultValue ("")]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [WebSysDescription("")]
+               [WebCategory("Appearance")]
                public string BgColor {
                        get {
                                string s = Attributes ["bgcolor"];
@@ -78,6 +81,8 @@ namespace System.Web.UI.HtmlControls {
 
                [DefaultValue ("")]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [WebSysDescription("")]
+               [WebCategory("Appearance")]
                public string BorderColor {
                        get {
                                string s = Attributes ["bordercolor"];
@@ -93,12 +98,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);
@@ -108,6 +108,8 @@ namespace System.Web.UI.HtmlControls {
 
                [DefaultValue ("")]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [WebSysDescription("")]
+               [WebCategory("Layout")]
                public string Height {
                        get {
                                string s = Attributes ["height"];
@@ -133,6 +135,8 @@ namespace System.Web.UI.HtmlControls {
 
                [DefaultValue ("")]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [WebSysDescription("")]
+               [WebCategory("Layout")]
                public string VAlign {
                        get {
                                string s = Attributes ["valign"];
@@ -146,7 +150,7 @@ namespace System.Web.UI.HtmlControls {
                        }
                }
 
-               private int Count {
+               int Count {
                        get { return (_cells == null) ? 0 : _cells.Count; }
                }
 
@@ -156,20 +160,11 @@ namespace System.Web.UI.HtmlControls {
                        return new HtmlTableCellControlCollection (this);
                }
 
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void RenderChildren (HtmlTextWriter writer)
+               protected internal 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 ();
                        }