blob: f08f657ee0c9cb474060c87ffa23f27ce77168ee (
plain)
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
|
/* System.Web.UI.HtmlControls
* Authors
* Leen Toelen (toelen@hotmail.com)
*/
using System;
using System.Web;
using System.Web.UI;
namespace System.Web.UI.HtmlControls{
public class HtmlTableRow : HtmlContainerControl {
private HtmlTableCellCollection _cells;
public HtmlTableRow():base("tr"){}
protected override ControlCollection CreateControlCollection(){
return new HtmlTableCellControlCollection(this);
}
protected override void RenderChildren(HtmlTextWriter writer){
writer.WriteLine();
writer.Indent = writer.Indent + 1;
base.RenderChildren(writer);
writer.Indent = writer.Indent - 1;
}
protected override void RenderEndTag(HtmlTextWriter writer){
base.RenderEndTag(writer);
writer.WriteLine();
}
public string Align {
get{
string attr = Attributes["align"];
if (attr != null) return attr;
return String.Empty;
}
set{
Attributes["align"] = AttributeToString(value);
}
}
public string BgColor {
get{
string attr = Attributes["bgcolor"];
if (attr != null) return attr;
return String.Empty;
}
set{
Attributes["bgcolor"] = AttributeToString(value);
}
}
public string BorderColor {
get{
string attr = Attributes["bordercolor"];
if (attr != null) return attr;
return String.Empty;
}
set{
Attributes["bordercolor"] = AttributeToString(value);
}
}
public virtual HtmlTableCellCollection Cells {
get{
if (_cells == null) _cells = new HtmlTableCellCollection(this);
return _cells;
}
}
public string Height {
get{
string attr = Attributes["height"];
if (attr != null) return attr;
return String.Empty;
}
set{
Attributes["height"] = AttributeToString(value);
}
}
public override string InnerHtml {
get{
throw new NotSupportedException("InnerHtml is not supported by HtmlTableRow");
}
set{
throw new NotSupportedException("InnerHtml is not supported by HtmlTableRow");
}
}
public override string InnerText {
get{
throw new NotSupportedException("InnerText is not supported by HtmlTableRow");
}
set{
throw new NotSupportedException("InnerText is not supported by HtmlTableRow");
}
}
public string VAlign {
get{
string attr = Attributes["valign"];
if (attr != null) return attr;
return String.Empty;
}
set{
Attributes["valign"] = AttributeToString(value);
}
}
protected class HtmlTableCellControlCollection : ControlCollection {
internal HtmlTableCellControlCollection(Control owner): base(owner){}
public override void Add(Control child){
if (child is HtmlTableCell){
base.Add(child);
}
else{
throw new ArgumentException("HtmlTableRow cannot have children of Type " + child.GetType().Name);
}
}
public override void AddAt(int index, Control child){
if (child is HtmlTableCell){
base.AddAt(index,child);
}
else{
throw new ArgumentException("HtmlTableRow cannot have children of Type " + child.GetType().Name);
}
}
}
} // end of System.Web.UI.HtmlControls.HtmlTableRow+HtmlTableCellControlCollection
// end of System.Web.UI.HtmlControls.HtmlTableRow
}
|