📄 tablecellcollection.cs
字号:
using System;
using System.Collections;
namespace System.Web.UI.WebControls
{
/// <summary>
/// Summary description for TableCellCollection.
/// </summary>
public sealed class TableCellCollection : IList,ICollection,IEnumerable
{
private System.Web.UI.WebControls.TableRow owner;
internal TableCellCollection(TableRow owner) : base()
{
this.owner = owner;
}
public int Add(TableCell cell)
{
this.AddAt(-1, cell);
return this.owner.Controls.Count - 1;
}
public void AddAt(int index, TableCell cell)
{
this.owner.Controls.AddAt(index, cell);
}
public void AddRange(System.Web.UI.WebControls.TableCell[] cells)
{
TableCell local0;
System.Web.UI.WebControls.TableCell[] local1;
int local2;
if (cells == null)
throw new ArgumentNullException("cells");
local1 = cells;
local2 = 0;
while (local2 < (int) local1.Length)
{
local0 = local1[local2];
this.Add(local0);
local2++;
}
}
public void Clear()
{
if (this.owner.HasControls())
this.owner.Controls.Clear();
}
public void CopyTo(Array array, int index)
{
IEnumerator local0;
local0 = this.GetEnumerator();
while (local0.MoveNext())
{
index = index + 1;
array.SetValue(local0.Current, index);
}
}
public int GetCellIndex(TableCell cell)
{
if (this.owner.HasControls())
return this.owner.Controls.IndexOf(cell);
return -1;
}
public IEnumerator GetEnumerator()
{
return this.owner.Controls.GetEnumerator();
}
public void Remove(TableCell cell)
{
this.owner.Controls.Remove(cell);
}
public void RemoveAt(int index)
{
this.owner.Controls.RemoveAt(index);
}
int System.Collections.IList.Add(object o)
{
return this.Add((TableCell) o);
}
bool System.Collections.IList.Contains(object o)
{
return this.owner.Controls.Contains((TableCell) o);
}
bool System.Collections.IList.IsFixedSize
{
get
{
return false;
}
}
object System.Collections.IList.this[int index]
{
get
{
return this.owner.Controls[index];
}
set
{
this.RemoveAt(index);
this.AddAt(index, (TableCell) value);
}
}
int System.Collections.IList.IndexOf(object o)
{
return this.owner.Controls.IndexOf((TableCell) o);
}
void System.Collections.IList.Insert(int index, object o)
{
this.owner.Controls.AddAt(index, (TableCell) o);
}
void System.Collections.IList.Remove(object o)
{
this.owner.Controls.Remove((TableCell) o);
}
public int Count
{
get
{
if (this.owner.HasControls())
return this.owner.Controls.Count;
return 0;
}
}
public bool IsReadOnly
{
get
{
return false;
}
}
public bool IsSynchronized
{
get
{
return false;
}
}
public TableCell this[int index]
{
get
{
return (TableCell) this.owner.Controls[index];
}
}
public object SyncRoot
{
get
{
return this;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -