HtmlTableCellCollection.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. namespace System.Web.UI.HtmlControls{
  9. public sealed class HtmlTableCellCollection : ICollection {
  10. private HtmlTableRow _owner;
  11. internal HtmlTableCellCollection(HtmlTableRow owner){
  12. _owner = owner;
  13. }
  14. public void Add(HtmlTableCell cell){
  15. Insert(-1, cell);
  16. }
  17. public void Clear(){
  18. if (_owner.HasConrols) _owner.Conrols.Clear;
  19. }
  20. public void CopyTo(Array array, int index){
  21. IEnumerator i = GetEnumerator;
  22. while(i.MoveNext){
  23. array.SetValue(i.Current, index++);
  24. }
  25. }
  26. public IEnumerator GetEnumerator(){
  27. return _owner.Controls.GetEnumerator;
  28. }
  29. public void Insert(int index, HtmlTableCell cell){
  30. _owner.Controls.AddAt(index,cell);
  31. }
  32. public void Remove(HtmlTableCell cell){
  33. _owner.Controls.Remove(cell);
  34. }
  35. public void RemoveAt(int index){
  36. _owner.Controls.RemoveAt(index);
  37. }
  38. public int Count {
  39. get{
  40. if (_owner.HasConrols) 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 (HtmlTableCell) _owner.Controls[index];
  57. }
  58. }
  59. public object SyncRoot {};
  60. } // end of System.Web.UI.HtmlControls.HtmlTableCellCollection
  61. }