📄 htmltable.cs
字号:
using System;
using System.Globalization;
using System.Web.UI;
namespace System.Web.UI.HtmlControls
{
/// <summary>
/// Summary description for HtmlTable.
/// </summary>
//.custom instance void System.Web.UI.ParseChildrenAttribute::.
public class HtmlTable : HtmlContainerControl
{
protected class HtmlTableRowControlCollection : ControlCollection
{
internal HtmlTableRowControlCollection(Control owner) : base(owner)
{
}
public virtual void Add(Control child)
{
if (child as HtmlTableRow != null)
{
this.Add(child);
return;
}
throw new ArgumentException(System.Web.HttpRuntime.FormatResourceString("Cannot_Have_Children_Of_Type", "HtmlTable", child.GetType().Name.ToString()));
}
public virtual void AddAt(int index, Control child)
{
if (child as HtmlTableRow != null)
{
this.AddAt(index, child);
return;
}
throw new ArgumentException(System.Web.HttpRuntime.FormatResourceString("Cannot_Have_Children_Of_Type", "HtmlTable", child.GetType().Name.ToString()));
}
}
private System.Web.UI.HtmlControls.HtmlTableRowCollection rows;
public HtmlTable() : base("table")
{
}
protected virtual ControlCollection CreateControlCollection()
{
return new HtmlTableRowControlCollection(this);
}
protected virtual void RenderChildren(HtmlTextWriter writer)
{
writer.WriteLine();
writer.Indent = writer.Indent + 1;
this.RenderChildren(writer);
writer.Indent = writer.Indent - 1;
}
protected virtual void RenderEndTag(HtmlTextWriter writer)
{
this.RenderEndTag(writer);
writer.WriteLine();
}
public string Align
{
get
{
string local0;
local0 = this.Attributes["align"];
if (local0 == null)
return "";
return local0;
}
set
{
this.Attributes["align"]= System.Web.UI.HtmlControls.HtmlControl.MapStringAttributeToString(value);
}
}
public string BgColor
{
get
{
string local0;
local0 = this.Attributes["bgcolor"];
if (local0 == null)
return "";
return local0;
}
set
{
this.Attributes["bgcolor"]= System.Web.UI.HtmlControls.HtmlControl.MapStringAttributeToString(value);
}
}
public int Border
{
get
{
string local0;
local0 = this.Attributes["border"];
if (local0 == null)
return -1;
return System.Int32.Parse(local0, CultureInfo.InvariantCulture);
}
set
{
this.Attributes["border"]= System.Web.UI.HtmlControls.HtmlControl.MapIntegerAttributeToString(value);
}
}
public string BorderColor
{
get
{
string local0;
local0 = this.Attributes["bordercolor"];
if (local0 == null)
return "";
return local0;
}
set
{
this.Attributes["bordercolor"]= System.Web.UI.HtmlControls.HtmlControl.MapStringAttributeToString(value);
}
}
public int CellPadding
{
get
{
string local0;
local0 = this.Attributes["cellpadding"];
if (local0 == null)
return -1;
return System.Int32.Parse(local0, CultureInfo.InvariantCulture);
}
set
{
this.Attributes["cellpadding"]= System.Web.UI.HtmlControls.HtmlControl.MapIntegerAttributeToString(value);
}
}
public int CellSpacing
{
get
{
string local0;
local0 = this.Attributes["cellspacing"];
if (local0 == null)
return -1;
return System.Int32.Parse(local0, CultureInfo.InvariantCulture);
}
set
{
this.Attributes["cellspacing"]= System.Web.UI.HtmlControls.HtmlControl.MapIntegerAttributeToString(value);
}
}
public string Height
{
get
{
string local0;
local0 = this.Attributes["height"];
if (local0 == null)
return "";
return local0;
}
set
{
this.Attributes["height"]= System.Web.UI.HtmlControls.HtmlControl.MapStringAttributeToString(value);
}
}
public virtual string InnerHtml
{
get
{
throw new NotSupportedException(System.Web.HttpRuntime.FormatResourceString("InnerHtml_not_supported", this.GetType().Name));
}
set
{
throw new NotSupportedException(System.Web.HttpRuntime.FormatResourceString("InnerHtml_not_supported", this.GetType().Name));
}
}
public virtual string InnerText
{
get
{
throw new NotSupportedException(System.Web.HttpRuntime.FormatResourceString("InnerText_not_supported", this.GetType().Name));
}
set
{
throw new NotSupportedException(System.Web.HttpRuntime.FormatResourceString("InnerText_not_supported", this.GetType().Name));
}
}
public virtual HtmlTableRowCollection Rows
{
get
{
if (this.rows == null)
this.rows = new HtmlTableRowCollection(this);
return this.rows;
}
}
public string Width
{
get
{
string local0;
local0 = this.Attributes["width"];
if (local0 == null)
return "";
return local0;
}
set
{
this.Attributes["width"]= System.Web.UI.HtmlControls.HtmlControl.MapStringAttributeToString(value);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -