mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 01:41:17 -10:00
* System.Web.UI/ControlCollection.cs: (AddAt): if index is -1 behave as a plain Add. * System.Web.UI.HtmlControls/HtmlSelect.cs: (RenderAttributes): new -> override and fixes stack overflow. (RenderChildren): only 1 option can be selected at any given time except when Multiple property is true. (Multiple): the attribute value is either "true" or "false", not "multiple". * System.Web.UI.HtmlControls/HtmlTable.cs: (Add): (AddAt): allow HtmlTableRow as children, not HtmlTableCell. * System.Web.UI.HtmlControls/HtmlTableCell.cs: (RenderEndTag): new -> override. * System.Web.UI.HtmlControls/HtmlTableRow.cs: (RenderChildren): fixed another stack overflow. (RenderEndTag): new -> override. * System.Web.UI.HtmlControls/HtmlTextArea.cs: (RenderAttributes): new -> override. svn path=/trunk/mcs/; revision=5193
138 lines
3.3 KiB
C#
Executable File
138 lines
3.3 KiB
C#
Executable File
/* System.Web.UI.HtmlControls
|
|
* Authors
|
|
* Leen Toelen ([email protected])
|
|
*/
|
|
|
|
using System;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
|
|
namespace System.Web.UI.HtmlControls{
|
|
public class HtmlTableRow : HtmlContainerControl {
|
|
private HtmlTableCellCollection _cells;
|
|
public HtmlTableRow():base("tr"){}
|
|
|
|
protected override ControlCollection CreateControlCollection(){
|
|
return new HtmlTableCellControlCollection(this);
|
|
}
|
|
|
|
protected override void RenderChildren(HtmlTextWriter writer){
|
|
writer.WriteLine();
|
|
writer.Indent = writer.Indent + 1;
|
|
base.RenderChildren(writer);
|
|
writer.Indent = writer.Indent - 1;
|
|
}
|
|
|
|
protected override void RenderEndTag(HtmlTextWriter writer){
|
|
base.RenderEndTag(writer);
|
|
writer.WriteLine();
|
|
}
|
|
|
|
public string Align {
|
|
get{
|
|
string attr = Attributes["align"];
|
|
if (attr != null) return attr;
|
|
return String.Empty;
|
|
}
|
|
set{
|
|
Attributes["align"] = AttributeToString(value);
|
|
}
|
|
}
|
|
|
|
public string BgColor {
|
|
get{
|
|
string attr = Attributes["bgcolor"];
|
|
if (attr != null) return attr;
|
|
return String.Empty;
|
|
}
|
|
set{
|
|
Attributes["bgcolor"] = AttributeToString(value);
|
|
}
|
|
}
|
|
|
|
public string BorderColor {
|
|
get{
|
|
string attr = Attributes["bordercolor"];
|
|
if (attr != null) return attr;
|
|
return String.Empty;
|
|
}
|
|
set{
|
|
Attributes["bordercolor"] = AttributeToString(value);
|
|
}
|
|
}
|
|
|
|
public virtual HtmlTableCellCollection Cells {
|
|
get{
|
|
if (_cells == null) _cells = new HtmlTableCellCollection(this);
|
|
return _cells;
|
|
}
|
|
}
|
|
|
|
public string Height {
|
|
get{
|
|
string attr = Attributes["height"];
|
|
if (attr != null) return attr;
|
|
return String.Empty;
|
|
}
|
|
set{
|
|
Attributes["height"] = AttributeToString(value);
|
|
}
|
|
}
|
|
|
|
public override string InnerHtml {
|
|
get{
|
|
throw new NotSupportedException("InnerHtml is not supported by HtmlTableRow");
|
|
}
|
|
set{
|
|
throw new NotSupportedException("InnerHtml is not supported by HtmlTableRow");
|
|
}
|
|
}
|
|
|
|
public override string InnerText {
|
|
get{
|
|
throw new NotSupportedException("InnerText is not supported by HtmlTableRow");
|
|
}
|
|
set{
|
|
throw new NotSupportedException("InnerText is not supported by HtmlTableRow");
|
|
}
|
|
}
|
|
|
|
public string VAlign {
|
|
get{
|
|
string attr = Attributes["valign"];
|
|
if (attr != null) return attr;
|
|
return String.Empty;
|
|
}
|
|
set{
|
|
Attributes["valign"] = AttributeToString(value);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
protected class HtmlTableCellControlCollection : ControlCollection {
|
|
|
|
internal HtmlTableCellControlCollection(Control owner): base(owner){}
|
|
|
|
public override void Add(Control child){
|
|
if (child is HtmlTableCell){
|
|
base.Add(child);
|
|
}
|
|
else{
|
|
throw new ArgumentException("HtmlTableRow cannot have children of Type " + child.GetType().Name);
|
|
}
|
|
}
|
|
|
|
public override void AddAt(int index, Control child){
|
|
if (child is HtmlTableCell){
|
|
base.AddAt(index,child);
|
|
}
|
|
else{
|
|
throw new ArgumentException("HtmlTableRow cannot have children of Type " + child.GetType().Name);
|
|
}
|
|
}
|
|
}
|
|
} // end of System.Web.UI.HtmlControls.HtmlTableRow+HtmlTableCellControlCollection
|
|
// end of System.Web.UI.HtmlControls.HtmlTableRow
|
|
}
|