2 // System.Web.UI.HtmlControls.HtmlTableRow.cs
5 // Sebastien Pouliot <sebastien@ximian.com>
7 // Copyright (C) 2005 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;
33 namespace System.Web.UI.HtmlControls {
36 [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
37 [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
39 [ConstructorNeedsTag (true)]
40 public class HtmlTableCell : HtmlContainerControl {
42 public HtmlTableCell ()
47 public HtmlTableCell (string tagName)
54 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
55 [WebSysDescription("")]
56 [WebCategory("Layout")]
59 string s = Attributes ["align"];
60 return (s == null) ? String.Empty : s;
64 Attributes.Remove ("align");
66 Attributes ["align"] = value;
71 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
72 [WebSysDescription("")]
73 [WebCategory("Appearance")]
74 public string BgColor {
76 string s = Attributes ["bgcolor"];
77 return (s == null) ? String.Empty : s;
81 Attributes.Remove ("bgcolor");
83 Attributes ["bgcolor"] = value;
88 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
89 [WebSysDescription("")]
90 [WebCategory("Appearance")]
91 public string BorderColor {
93 string s = Attributes ["bordercolor"];
94 return (s == null) ? String.Empty : s;
98 Attributes.Remove ("bordercolor");
100 Attributes ["bordercolor"] = value;
105 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
106 [WebSysDescription("")]
107 [WebCategory("Layout")]
110 string s = Attributes ["colspan"];
111 return (s == null) ? -1 : Convert.ToInt32 (s);
115 Attributes.Remove ("colspan");
117 Attributes ["colspan"] = value.ToString (CultureInfo.InvariantCulture);
122 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
123 [WebSysDescription("")]
124 [WebCategory("Layout")]
125 public string Height {
127 string s = Attributes ["height"];
128 return (s == null) ? String.Empty : s;
132 Attributes.Remove ("align");
134 Attributes ["height"] = value;
139 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
141 [TypeConverter (typeof (MinimizableAttributeTypeConverter))]
143 [WebSysDescription("")]
144 [WebCategory("Behavior")]
146 get { return (Attributes ["nowrap"] == "nowrap"); }
149 Attributes ["nowrap"] = "nowrap";
151 Attributes.Remove ("nowrap");
156 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
157 [WebSysDescription("")]
158 [WebCategory("Layout")]
161 string s = Attributes ["rowspan"];
162 return (s == null) ? -1 : Convert.ToInt32 (s);
166 Attributes.Remove ("rowspan");
168 Attributes ["rowspan"] = value.ToString (CultureInfo.InvariantCulture);
173 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
174 [WebSysDescription("")]
175 [WebCategory("Appearance")]
176 public string VAlign {
178 string s = Attributes ["valign"];
179 return (s == null) ? String.Empty : s;
183 Attributes.Remove ("valign");
185 Attributes ["valign"] = value;
190 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
191 [WebSysDescription("")]
192 [WebCategory("Layout")]
193 public string Width {
195 string s = Attributes ["width"];
196 return (s == null) ? String.Empty : s;
200 Attributes.Remove ("width");
202 Attributes ["width"] = value;
207 protected override void RenderEndTag (HtmlTextWriter writer)
209 writer.WriteEndTag (TagName);
210 if (writer.Indent == 0)