2 // System.Web.UI.HtmlControls.HtmlTableRow.cs
5 // Sebastien Pouliot <sebastien@ximian.com>
7 // Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 using System.ComponentModel;
30 using System.Globalization;
31 using System.Security.Permissions;
32 using System.Web.Util;
34 namespace System.Web.UI.HtmlControls
37 [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
38 [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
40 [ConstructorNeedsTag (true)]
41 public class HtmlTableCell : HtmlContainerControl
43 public HtmlTableCell ()
48 public HtmlTableCell (string tagName)
55 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
56 [WebSysDescription("")]
57 [WebCategory("Layout")]
60 string s = Attributes ["align"];
61 return (s == null) ? String.Empty : s;
65 Attributes.Remove ("align");
67 Attributes ["align"] = value;
72 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
73 [WebSysDescription("")]
74 [WebCategory("Appearance")]
75 public string BgColor {
77 string s = Attributes ["bgcolor"];
78 return (s == null) ? String.Empty : s;
82 Attributes.Remove ("bgcolor");
84 Attributes ["bgcolor"] = value;
89 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
90 [WebSysDescription("")]
91 [WebCategory("Appearance")]
92 public string BorderColor {
94 string s = Attributes ["bordercolor"];
95 return (s == null) ? String.Empty : s;
99 Attributes.Remove ("bordercolor");
101 Attributes ["bordercolor"] = value;
106 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
107 [WebSysDescription("")]
108 [WebCategory("Layout")]
111 string s = Attributes ["colspan"];
112 return (s == null) ? -1 : Convert.ToInt32 (s);
116 Attributes.Remove ("colspan");
118 Attributes ["colspan"] = value.ToString (Helpers.InvariantCulture);
123 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
124 [WebSysDescription("")]
125 [WebCategory("Layout")]
126 public string Height {
128 string s = Attributes ["height"];
129 return (s == null) ? String.Empty : s;
133 Attributes.Remove ("align");
135 Attributes ["height"] = value;
140 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
141 [TypeConverter (typeof (MinimizableAttributeTypeConverter))]
142 [WebSysDescription("")]
143 [WebCategory("Behavior")]
145 get { return (Attributes ["nowrap"] == "nowrap"); }
148 Attributes ["nowrap"] = "nowrap";
150 Attributes.Remove ("nowrap");
155 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
156 [WebSysDescription("")]
157 [WebCategory("Layout")]
160 string s = Attributes ["rowspan"];
161 return (s == null) ? -1 : Convert.ToInt32 (s);
165 Attributes.Remove ("rowspan");
167 Attributes ["rowspan"] = value.ToString (Helpers.InvariantCulture);
172 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
173 [WebSysDescription("")]
174 [WebCategory("Appearance")]
175 public string VAlign {
177 string s = Attributes ["valign"];
178 return (s == null) ? String.Empty : s;
182 Attributes.Remove ("valign");
184 Attributes ["valign"] = value;
189 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
190 [WebSysDescription("")]
191 [WebCategory("Layout")]
192 public string Width {
194 string s = Attributes ["width"];
195 return (s == null) ? String.Empty : s;
199 Attributes.Remove ("width");
201 Attributes ["width"] = value;
206 protected override void RenderEndTag (HtmlTextWriter writer)
208 writer.WriteEndTag (TagName);
209 if (writer.Indent == 0)