Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / UI / HtmlControls / HtmlTable.cs / 5 / HtmlTable.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.HtmlControls {
using System;
using System.Reflection;
using System.Collections;
using System.ComponentModel;
using System.Globalization;
using System.Web;
using System.Web.UI;
using System.Security.Permissions;
///
/// Defines the properties, methods, and events for the
///
/// control that allows programmatic access on the
/// server to the HTML <table> element.
///
[
ParseChildren(true, "Rows")
]
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public class HtmlTable : HtmlContainerControl {
HtmlTableRowCollection rows;
///
/// Initializes a new instance of the class.
///
public HtmlTable() : base("table") {
}
///
/// Gets or sets the alignment of content within the
/// control.
///
[
WebCategory("Layout"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string Align {
get {
string s = Attributes["align"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["align"] = MapStringAttributeToString(value);
}
}
///
/// Gets or sets the background color of an
/// control.
///
[
WebCategory("Appearance"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string BgColor {
get {
string s = Attributes["bgcolor"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["bgcolor"] = MapStringAttributeToString(value);
}
}
///
/// Gets or sets the width of the border, in pixels, of an
/// control.
///
[
WebCategory("Appearance"),
DefaultValue(-1),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public int Border {
get {
string s = Attributes["border"];
return((s != null) ? Int32.Parse(s, CultureInfo.InvariantCulture) : -1);
}
set {
Attributes["border"] = MapIntegerAttributeToString(value);
}
}
///
/// Gets or sets the border color of an control.
///
[
WebCategory("Appearance"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string BorderColor {
get {
string s = Attributes["bordercolor"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["bordercolor"] = MapStringAttributeToString(value);
}
}
///
///
/// Gets or sets the cell padding, in pixels, for an control.
///
///
[
WebCategory("Appearance"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public int CellPadding {
get {
string s = Attributes["cellpadding"];
return((s != null) ? Int32.Parse(s, CultureInfo.InvariantCulture) : -1);
}
set {
Attributes["cellpadding"] = MapIntegerAttributeToString(value);
}
}
///
///
/// Gets or sets the cell spacing, in pixels, for an control.
///
///
[
WebCategory("Appearance"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public int CellSpacing {
get {
string s = Attributes["cellspacing"];
return((s != null) ? Int32.Parse(s, CultureInfo.InvariantCulture) : -1);
}
set {
Attributes["cellspacing"] = MapIntegerAttributeToString(value);
}
}
///
/// [To be supplied.]
///
public override string InnerHtml {
get {
throw new NotSupportedException(SR.GetString(SR.InnerHtml_not_supported, this.GetType().Name));
}
set {
throw new NotSupportedException(SR.GetString(SR.InnerHtml_not_supported, this.GetType().Name));
}
}
///
/// [To be supplied.]
///
public override string InnerText {
get {
throw new NotSupportedException(SR.GetString(SR.InnerText_not_supported, this.GetType().Name));
}
set {
throw new NotSupportedException(SR.GetString(SR.InnerText_not_supported, this.GetType().Name));
}
}
///
///
/// Gets or sets the height of an
/// control.
///
///
[
WebCategory("Layout"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string Height {
get {
string s = Attributes["height"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["height"] = MapStringAttributeToString(value);
}
}
///
///
/// Gets or sets the width of an control.
///
///
[
WebCategory("Layout"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string Width {
get {
string s = Attributes["width"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["width"] = MapStringAttributeToString(value);
}
}
///
///
/// Gets a collection that contains all of the rows in an
/// control. An empty collection is returned if no
/// <tr> elements are contained within the control.
///
///
[
Browsable(false),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
IgnoreUnknownContent()
]
public virtual HtmlTableRowCollection Rows {
get {
if (rows == null)
rows = new HtmlTableRowCollection(this);
return rows;
}
}
///
///
///
protected internal override void RenderChildren(HtmlTextWriter writer) {
writer.WriteLine();
writer.Indent++;
base.RenderChildren(writer);
writer.Indent--;
}
///
///
///
protected override void RenderEndTag(HtmlTextWriter writer) {
base.RenderEndTag(writer);
writer.WriteLine();
}
///
/// [To be supplied.]
///
protected override ControlCollection CreateControlCollection() {
return new HtmlTableRowControlCollection(this);
}
///
/// [To be supplied.]
///
protected class HtmlTableRowControlCollection : ControlCollection {
internal HtmlTableRowControlCollection (Control owner) : base(owner) {
}
///
/// Adds the specified object to the collection. The new control is added
/// to the end of the array.
///
public override void Add(Control child) {
if (child is HtmlTableRow)
base.Add(child);
else
throw new ArgumentException(SR.GetString(SR.Cannot_Have_Children_Of_Type, "HtmlTable", child.GetType().Name.ToString(CultureInfo.InvariantCulture))); // throw an exception here
}
///
/// Adds the specified object to the collection. The new control is added
/// to the array at the specified index location.
///
public override void AddAt(int index, Control child) {
if (child is HtmlTableRow)
base.AddAt(index, child);
else
throw new ArgumentException(SR.GetString(SR.Cannot_Have_Children_Of_Type, "HtmlTable", child.GetType().Name.ToString(CultureInfo.InvariantCulture))); // throw an exception here
}
} // class HtmlTableRowControlCollection
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.HtmlControls {
using System;
using System.Reflection;
using System.Collections;
using System.ComponentModel;
using System.Globalization;
using System.Web;
using System.Web.UI;
using System.Security.Permissions;
///
/// Defines the properties, methods, and events for the
///
/// control that allows programmatic access on the
/// server to the HTML <table> element.
///
[
ParseChildren(true, "Rows")
]
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public class HtmlTable : HtmlContainerControl {
HtmlTableRowCollection rows;
///
/// Initializes a new instance of the class.
///
public HtmlTable() : base("table") {
}
///
/// Gets or sets the alignment of content within the
/// control.
///
[
WebCategory("Layout"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string Align {
get {
string s = Attributes["align"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["align"] = MapStringAttributeToString(value);
}
}
///
/// Gets or sets the background color of an
/// control.
///
[
WebCategory("Appearance"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string BgColor {
get {
string s = Attributes["bgcolor"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["bgcolor"] = MapStringAttributeToString(value);
}
}
///
/// Gets or sets the width of the border, in pixels, of an
/// control.
///
[
WebCategory("Appearance"),
DefaultValue(-1),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public int Border {
get {
string s = Attributes["border"];
return((s != null) ? Int32.Parse(s, CultureInfo.InvariantCulture) : -1);
}
set {
Attributes["border"] = MapIntegerAttributeToString(value);
}
}
///
/// Gets or sets the border color of an control.
///
[
WebCategory("Appearance"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string BorderColor {
get {
string s = Attributes["bordercolor"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["bordercolor"] = MapStringAttributeToString(value);
}
}
///
///
/// Gets or sets the cell padding, in pixels, for an control.
///
///
[
WebCategory("Appearance"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public int CellPadding {
get {
string s = Attributes["cellpadding"];
return((s != null) ? Int32.Parse(s, CultureInfo.InvariantCulture) : -1);
}
set {
Attributes["cellpadding"] = MapIntegerAttributeToString(value);
}
}
///
///
/// Gets or sets the cell spacing, in pixels, for an control.
///
///
[
WebCategory("Appearance"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public int CellSpacing {
get {
string s = Attributes["cellspacing"];
return((s != null) ? Int32.Parse(s, CultureInfo.InvariantCulture) : -1);
}
set {
Attributes["cellspacing"] = MapIntegerAttributeToString(value);
}
}
///
/// [To be supplied.]
///
public override string InnerHtml {
get {
throw new NotSupportedException(SR.GetString(SR.InnerHtml_not_supported, this.GetType().Name));
}
set {
throw new NotSupportedException(SR.GetString(SR.InnerHtml_not_supported, this.GetType().Name));
}
}
///
/// [To be supplied.]
///
public override string InnerText {
get {
throw new NotSupportedException(SR.GetString(SR.InnerText_not_supported, this.GetType().Name));
}
set {
throw new NotSupportedException(SR.GetString(SR.InnerText_not_supported, this.GetType().Name));
}
}
///
///
/// Gets or sets the height of an
/// control.
///
///
[
WebCategory("Layout"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string Height {
get {
string s = Attributes["height"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["height"] = MapStringAttributeToString(value);
}
}
///
///
/// Gets or sets the width of an control.
///
///
[
WebCategory("Layout"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public string Width {
get {
string s = Attributes["width"];
return((s != null) ? s : String.Empty);
}
set {
Attributes["width"] = MapStringAttributeToString(value);
}
}
///
///
/// Gets a collection that contains all of the rows in an
/// control. An empty collection is returned if no
/// <tr> elements are contained within the control.
///
///
[
Browsable(false),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
IgnoreUnknownContent()
]
public virtual HtmlTableRowCollection Rows {
get {
if (rows == null)
rows = new HtmlTableRowCollection(this);
return rows;
}
}
///
///
///
protected internal override void RenderChildren(HtmlTextWriter writer) {
writer.WriteLine();
writer.Indent++;
base.RenderChildren(writer);
writer.Indent--;
}
///
///
///
protected override void RenderEndTag(HtmlTextWriter writer) {
base.RenderEndTag(writer);
writer.WriteLine();
}
///
/// [To be supplied.]
///
protected override ControlCollection CreateControlCollection() {
return new HtmlTableRowControlCollection(this);
}
///
/// [To be supplied.]
///
protected class HtmlTableRowControlCollection : ControlCollection {
internal HtmlTableRowControlCollection (Control owner) : base(owner) {
}
///
/// Adds the specified object to the collection. The new control is added
/// to the end of the array.
///
public override void Add(Control child) {
if (child is HtmlTableRow)
base.Add(child);
else
throw new ArgumentException(SR.GetString(SR.Cannot_Have_Children_Of_Type, "HtmlTable", child.GetType().Name.ToString(CultureInfo.InvariantCulture))); // throw an exception here
}
///
/// Adds the specified object to the collection. The new control is added
/// to the array at the specified index location.
///
public override void AddAt(int index, Control child) {
if (child is HtmlTableRow)
base.AddAt(index, child);
else
throw new ArgumentException(SR.GetString(SR.Cannot_Have_Children_Of_Type, "HtmlTable", child.GetType().Name.ToString(CultureInfo.InvariantCulture))); // throw an exception here
}
} // class HtmlTableRowControlCollection
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PointAnimationClockResource.cs
- TimersDescriptionAttribute.cs
- SystemException.cs
- AuthorizationPolicyTypeElementCollection.cs
- ConstraintCollection.cs
- WebRequestModuleElement.cs
- FlowLayoutPanelDesigner.cs
- TableLayoutStyle.cs
- ToolStripItemTextRenderEventArgs.cs
- BitmapEncoder.cs
- WindowPatternIdentifiers.cs
- DataBoundLiteralControl.cs
- ImageList.cs
- DeviceContexts.cs
- CodeParameterDeclarationExpression.cs
- NativeMethodsCLR.cs
- SchemaAttDef.cs
- Helper.cs
- Stroke.cs
- TrackingWorkflowEventArgs.cs
- PropertyCollection.cs
- TabItem.cs
- DispatcherExceptionFilterEventArgs.cs
- KoreanLunisolarCalendar.cs
- WindowsListViewGroup.cs
- FontFamily.cs
- PointUtil.cs
- TakeQueryOptionExpression.cs
- UpdateTracker.cs
- AssemblyInfo.cs
- xamlnodes.cs
- StateManagedCollection.cs
- FormsIdentity.cs
- WebConfigurationHost.cs
- DataGridViewSelectedCellCollection.cs
- UnmanagedMemoryStreamWrapper.cs
- RepeaterCommandEventArgs.cs
- DiscriminatorMap.cs
- CodeSnippetTypeMember.cs
- LayoutTable.cs
- ExpressionBindingCollection.cs
- PnrpPeerResolverElement.cs
- ByteKeyFrameCollection.cs
- Soap12ProtocolReflector.cs
- ToolStripButton.cs
- ContextMenuStrip.cs
- TdsEnums.cs
- QilFactory.cs
- NavigationPropertyEmitter.cs
- DataTableNewRowEvent.cs
- Base64Decoder.cs
- SqlReferenceCollection.cs
- SmiEventStream.cs
- RTTrackingProfile.cs
- InvokeDelegate.cs
- OracleSqlParser.cs
- SymmetricKeyWrap.cs
- ThicknessKeyFrameCollection.cs
- OdbcError.cs
- ProviderException.cs
- CodeExporter.cs
- StateMachine.cs
- BinaryFormatter.cs
- ViewStateException.cs
- IconConverter.cs
- CssClassPropertyAttribute.cs
- DataGridViewBindingCompleteEventArgs.cs
- FastEncoderWindow.cs
- WinFormsComponentEditor.cs
- GroupJoinQueryOperator.cs
- RtType.cs
- precedingsibling.cs
- DataSourceProvider.cs
- SafePointer.cs
- TableCellAutomationPeer.cs
- AddInStore.cs
- ProcessStartInfo.cs
- GiveFeedbackEvent.cs
- SqlConnectionPoolGroupProviderInfo.cs
- SoapEnumAttribute.cs
- GeneralTransform3D.cs
- ZoneIdentityPermission.cs
- WebPartManager.cs
- TextPattern.cs
- EventProviderClassic.cs
- SiteMapDataSourceView.cs
- DocumentSchemaValidator.cs
- TargetInvocationException.cs
- PeerCollaboration.cs
- OleDbReferenceCollection.cs
- HtmlAnchor.cs
- XPathScanner.cs
- DataGridTemplateColumn.cs
- SID.cs
- ConfigurationProperty.cs
- ToolStripHighContrastRenderer.cs
- SqlFacetAttribute.cs
- xdrvalidator.cs
- StateMachineSubscription.cs
- HttpConfigurationContext.cs