HtmlTableRowCollection.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* System.Web.UI.HtmlControls
  2. * Authors
  3. * Leen Toelen ([email protected])
  4. */
  5. using System;
  6. using System.Web;
  7. using System.Web.UI;
  8. using System.Collections;
  9. namespace System.Web.UI.HtmlControls{
  10. public sealed class HtmlTableRowCollection : ICollection {
  11. private HtmlTable _owner;
  12. internal HtmlTableRowCollection(HtmlTable owner){
  13. _owner = owner;
  14. }
  15. public void Add(HtmlTableRow row){
  16. Insert(-1, row);
  17. }
  18. public void Clear(){
  19. if (_owner.HasControls()) _owner.Controls.Clear();
  20. }
  21. public void CopyTo(Array array, int index){
  22. //FIXME: foreach(IEnumerator i in GetEnumerator()){
  23. // array.SetValue(i, index+1);
  24. //}
  25. }
  26. public IEnumerator GetEnumerator(){
  27. return _owner.Controls.GetEnumerator();
  28. }
  29. public void Insert(int index, HtmlTableRow row){
  30. _owner.Controls.AddAt(index,row);
  31. }
  32. public void Remove(HtmlTableRow row){
  33. _owner.Controls.Remove(row);
  34. }
  35. public void RemoveAt(int index){
  36. _owner.Controls.RemoveAt(index);
  37. }
  38. public int Count {
  39. get{
  40. if (_owner.HasControls()) return _owner.Controls.Count;
  41. return 0;
  42. }
  43. }
  44. public bool IsReadOnly {
  45. get{
  46. return false;
  47. }
  48. }
  49. public bool IsSynchronized {
  50. get{
  51. return false;
  52. }
  53. }
  54. public HtmlTableRow this[int index] {
  55. get{
  56. return (HtmlTableRow) _owner.Controls[index];
  57. }
  58. }
  59. public object SyncRoot {
  60. get{
  61. //LAMESPEC: what to return
  62. return null;
  63. }
  64. }
  65. }
  66. // end of System.Web.UI.HtmlControls.HtmlTableRowCollection
  67. }