-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathHtmlTableRow.cs
261 lines (219 loc) · 8.09 KB
/
HtmlTableRow.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
//------------------------------------------------------------------------------
// <copyright file="HtmlTableRow.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace System.Web.UI.HtmlControls {
using System;
using System.Collections;
using System.ComponentModel;
using System.Globalization;
using System.Web;
using System.Web.UI;
using System.Security.Permissions;
/// <devdoc>
/// <para>
/// The <see langword='HtmlTableRow'/>
/// class defines the properties, methods, and events for the HtmlTableRow control.
/// This class allows programmatic access on the server to individual HTML
/// <tr> elements enclosed within an <see cref='System.Web.UI.HtmlControls.HtmlTable'/> control.
/// </para>
/// </devdoc>
[
ParseChildren(true, "Cells")
]
public class HtmlTableRow : HtmlContainerControl {
HtmlTableCellCollection cells;
public HtmlTableRow() : base("tr") {
}
/// <devdoc>
/// <para>
/// Gets or sets the horizontal alignment of the cells contained in an
/// <see langword='HtmlTableRow'/> control.
/// </para>
/// </devdoc>
[
WebCategory("Layout"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string Align {
get {
string s = Attributes["align"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["align"] = MapStringAttributeToString(value);
}
}
/*
* Collection of child TableCells.
*/
/// <devdoc>
/// <para>
/// Gets or sets the group of table cells contained within an
/// <see langword='HtmlTableRow'/> control.
/// </para>
/// </devdoc>
[
Browsable(false),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
]
public virtual HtmlTableCellCollection Cells {
get {
if (cells == null)
cells = new HtmlTableCellCollection(this);
return cells;
}
}
/// <devdoc>
/// <para>
/// Gets or sets the background color of an <see langword='HtmlTableRow'/>
/// control.
/// </para>
/// </devdoc>
[
WebCategory("Appearance"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string BgColor {
get {
string s = Attributes["bgcolor"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["bgcolor"] = MapStringAttributeToString(value);
}
}
/// <devdoc>
/// <para>
/// Gets or sets the border color of an <see langword='HtmlTableRow'/> control.
/// </para>
/// </devdoc>
[
WebCategory("Appearance"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string BorderColor {
get {
string s = Attributes["bordercolor"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["bordercolor"] = MapStringAttributeToString(value);
}
}
/// <devdoc>
/// <para>
/// Gets or sets the height of an <see langword='HtmlTableRow'/> control.
/// </para>
/// </devdoc>
[
WebCategory("Layout"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string Height {
get {
string s = Attributes["height"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["height"] = MapStringAttributeToString(value);
}
}
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public override string InnerHtml {
get {
throw new NotSupportedException(SR.GetString(SR.InnerHtml_not_supported, this.GetType().Name));
}
set {
throw new NotSupportedException(SR.GetString(SR.InnerHtml_not_supported, this.GetType().Name));
}
}
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public override string InnerText {
get {
throw new NotSupportedException(SR.GetString(SR.InnerText_not_supported, this.GetType().Name));
}
set {
throw new NotSupportedException(SR.GetString(SR.InnerText_not_supported, this.GetType().Name));
}
}
/// <devdoc>
/// <para>
/// Gets or sets the vertical alignment of of the cells contained in an
/// <see langword='HtmlTableRow'/> control.
/// </para>
/// </devdoc>
[
WebCategory("Layout"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string VAlign {
get {
string s = Attributes["valign"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["valign"] = MapStringAttributeToString(value);
}
}
/// <internalonly/>
/// <devdoc>
/// </devdoc>
protected internal override void RenderChildren(HtmlTextWriter writer) {
writer.WriteLine();
writer.Indent++;
base.RenderChildren(writer);
writer.Indent--;
}
/// <internalonly/>
/// <devdoc>
/// </devdoc>
protected override void RenderEndTag(HtmlTextWriter writer) {
base.RenderEndTag(writer);
writer.WriteLine();
}
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
protected override ControlCollection CreateControlCollection() {
return new HtmlTableCellControlCollection(this);
}
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
protected class HtmlTableCellControlCollection : ControlCollection {
internal HtmlTableCellControlCollection (Control owner) : base(owner) {
}
/// <devdoc>
/// <para>Adds the specified <see cref='System.Web.UI.Control'/> object to the collection. The new control is added
/// to the end of the array.</para>
/// </devdoc>
public override void Add(Control child) {
if (child is HtmlTableCell)
base.Add(child);
else
throw new ArgumentException(SR.GetString(SR.Cannot_Have_Children_Of_Type, "HtmlTableRow", child.GetType().Name.ToString(CultureInfo.InvariantCulture))); // throw an exception here
}
/// <devdoc>
/// <para>Adds the specified <see cref='System.Web.UI.Control'/> object to the collection. The new control is added
/// to the array at the specified index location.</para>
/// </devdoc>
public override void AddAt(int index, Control child) {
if (child is HtmlTableCell)
base.AddAt(index, child);
else
throw new ArgumentException(SR.GetString(SR.Cannot_Have_Children_Of_Type, "HtmlTableRow", child.GetType().Name.ToString(CultureInfo.InvariantCulture))); // throw an exception here
}
}
}
}