Flush pending changes I got from a contributor that did not put his name in
[mono.git] / mcs / class / System.Web / System.Web.UI.HtmlControls / HtmlTableRowCollection.cs
1 /*      System.Web.UI.HtmlControls
2 *       Authors
3 *               Leen Toelen (toelen@hotmail.com)
4 */
5
6 using System;
7 using System.Web;
8 using System.Web.UI;
9 using System.Collections;
10
11 namespace System.Web.UI.HtmlControls{
12         public sealed class HtmlTableRowCollection : ICollection {
13                 
14                 private HtmlTable _owner;
15                 
16                 internal HtmlTableRowCollection(HtmlTable owner){
17                         _owner = owner;
18                 }
19                 
20                 public void Add(HtmlTableRow row){
21                         Insert(-1, row);
22                 }
23                 
24                 public void Clear(){
25                         if (_owner.HasControls()) _owner.Controls.Clear();
26                 }
27                 
28                 public void CopyTo(Array array, int index){
29                         //FIXME: foreach(IEnumerator i in GetEnumerator()){
30                         //      array.SetValue(i, index+1);
31                         //}
32                 }
33                 
34                 public IEnumerator GetEnumerator(){
35                         return _owner.Controls.GetEnumerator();
36                 }
37                 
38                 public void Insert(int index, HtmlTableRow row){
39                         _owner.Controls.AddAt(index,row);
40                 }
41                 
42                 public void Remove(HtmlTableRow row){
43                         _owner.Controls.Remove(row);
44                 }
45                 
46                 public void RemoveAt(int index){
47                         _owner.Controls.RemoveAt(index);
48                 }
49                 
50                 public int Count {
51                         get{
52                                 if (_owner.HasControls()) return _owner.Controls.Count;
53                                 return 0;
54                         }
55                 }
56                 
57                 public bool IsReadOnly {
58                         get{
59                                 return false;
60                         }
61                 }
62                 
63                 public bool IsSynchronized {
64                         get{
65                                 return false;
66                         }
67                 }
68                 
69                 public HtmlTableRow this[int index] {
70                         get{
71                                 return (HtmlTableRow) _owner.Controls[index];
72                         }
73                 }
74                 
75                 public object SyncRoot {
76                         get{
77                                 //LAMESPEC: what to return
78                                 return null;
79                         }
80         }
81         }
82         // end of System.Web.UI.HtmlControls.HtmlTableRowCollection
83 }