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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
//------------------------------------------------------------------------------
// <copyright file="HtmlTableRowCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
/*
* HtmlTableRowCollection.cs
*
* Copyright (c) 2000 Microsoft Corporation
*/
namespace System.Web.UI.HtmlControls {
using System.Runtime.InteropServices;
using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Security.Permissions;
/// <devdoc>
/// <para>
/// The <see langword='HtmlTableRowCollection'/> contains all
/// of the table rows found within an <see langword='HtmlTable'/>
/// server control.
/// </para>
/// </devdoc>
public sealed class HtmlTableRowCollection : ICollection {
/// <internalonly/>
/// <devdoc>
/// </devdoc>
private HtmlTable owner;
internal HtmlTableRowCollection(HtmlTable owner) {
this.owner = owner;
}
/*
* The number of cells in the row.
*/
/// <devdoc>
/// <para>
/// Gets the number of items in the
/// <see langword='HtmlTableRow'/>
/// collection.
/// </para>
/// </devdoc>
public int Count {
get {
if (owner.HasControls())
return owner.Controls.Count;
return 0;
}
}
/// <devdoc>
/// <para>
/// Gets an <see langword='HtmlTableRow'/> control from an <see langword='HtmlTable'/>
/// control thorugh the row's ordinal index value.
/// </para>
/// </devdoc>
public HtmlTableRow this[int index]
{
get {
return(HtmlTableRow)owner.Controls[index];
}
}
/// <devdoc>
/// <para>
/// Adds the specified HtmlTableRow control to the end of the collection.
/// </para>
/// </devdoc>
public void Add(HtmlTableRow row) {
Insert(-1, row);
}
/// <devdoc>
/// <para>
/// Adds an <see langword='HtmlTableRow'/> control to a specified
/// location in the collection.
/// </para>
/// </devdoc>
public void Insert(int index, HtmlTableRow row) {
owner.Controls.AddAt(index, row);
}
/// <devdoc>
/// <para>
/// Deletes all <see langword='HtmlTableRow'/> controls from the collection.
/// </para>
/// </devdoc>
public void Clear() {
if (owner.HasControls())
owner.Controls.Clear();
}
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public void CopyTo(Array array, int index) {
for (IEnumerator e = this.GetEnumerator(); e.MoveNext();)
array.SetValue(e.Current, index++);
}
/// <devdoc>
/// </devdoc>
public Object SyncRoot {
get { return this;}
}
/// <devdoc>
/// </devdoc>
public bool IsReadOnly {
get { return false;}
}
/// <devdoc>
/// </devdoc>
public bool IsSynchronized {
get { return false;}
}
/// <devdoc>
/// </devdoc>
public IEnumerator GetEnumerator() {
return owner.Controls.GetEnumerator();
}
/// <devdoc>
/// <para>
/// Deletes the specified <see langword='HtmlTableRow'/>
/// control
/// from the collection.
/// </para>
/// </devdoc>
public void Remove(HtmlTableRow row) {
owner.Controls.Remove(row);
}
/// <devdoc>
/// <para>
/// Deletes the <see langword='HtmlTableRow'/> control at the specified index
/// location from the collection.
/// </para>
/// </devdoc>
public void RemoveAt(int index) {
owner.Controls.RemoveAt(index);
}
}
}
|