Welcome to mirror list, hosted at ThFree Co, Russian Federation.

HtmlTableCellCollection.cs « System.Web.UI.HtmlControls « System.Web « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e6926f10eb7efe3b73ecf5f25839d9d7ffa55a60 (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
/*	System.Web.UI.HtmlControls
*	Authors
*		Leen Toelen (toelen@hotmail.com)
*/

using System;
using System.Web;
using System.Web.UI;
using System.Collections;

namespace System.Web.UI.HtmlControls{
	public sealed class HtmlTableCellCollection : ICollection {
		private HtmlTableRow _owner;
		
		internal HtmlTableCellCollection(HtmlTableRow owner){
			_owner = owner;
		}
		
		public void Add(HtmlTableCell cell){
			Insert(-1, cell);
		}
		
		public void Clear(){
			if (_owner.HasControls()) _owner.Controls.Clear();
		}
		
		public void CopyTo(Array array, int index){
			IEnumerator tablecell = this.GetEnumerator();
			while(tablecell.MoveNext()){
				index = index + 1;
				array.SetValue(tablecell.Current, index);
			}
		}
		
		public IEnumerator GetEnumerator(){
			return _owner.Controls.GetEnumerator();
		}
		
		public void Insert(int index, HtmlTableCell cell){
			_owner.Controls.AddAt(index,cell);
		}
		
		public void Remove(HtmlTableCell cell){
			_owner.Controls.Remove(cell);
		}
		
		public void RemoveAt(int index){
			_owner.Controls.RemoveAt(index);
		}
		
		public int Count {
			get{
				if (_owner.HasControls()) return _owner.Controls.Count;
				return 0;
			}
		}
		
		public bool IsReadOnly {
			get{
				return false;
			}
		}
		
		public bool IsSynchronized {
			get{
				return false;
			}
		}
		
		public HtmlTableCell this[int index] {
			get{
				return _owner.Controls[index] as HtmlTableCell;
			}
		}
		
		public object SyncRoot {
			get{
				return null;
			}
		}
		
	} // end of System.Web.UI.HtmlControls.HtmlTableCellCollection
	
}