Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / UI / WebControls / TableRow.cs / 5 / TableRow.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls {
using System;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Globalization;
using System.Web;
using System.Web.UI;
using System.Security.Permissions;
///
/// Encapsulates a row
/// within a table.
///
[
Bindable(false),
DefaultProperty("Cells"),
ParseChildren(true, "Cells"),
ToolboxItem(false)
]
[Designer("System.Web.UI.Design.WebControls.PreviewControlDesigner, " + AssemblyRef.SystemDesign)]
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public class TableRow : WebControl {
TableCellCollection cells;
///
///
/// Initializes a new instance of the class.
///
///
public TableRow() : base(HtmlTextWriterTag.Tr) {
PreventAutoID();
}
///
/// Indicates the table cell collection of the table
/// row. This property is read-only.
///
[
MergableProperty(false),
WebSysDescription(SR.TableRow_Cells),
PersistenceMode(PersistenceMode.InnerDefaultProperty)
]
public virtual TableCellCollection Cells {
get {
if (cells == null)
cells = new TableCellCollection(this);
return cells;
}
}
///
/// Indicates the horizontal alignment of the content within the table cells.
///
[
WebCategory("Layout"),
DefaultValue(HorizontalAlign.NotSet),
WebSysDescription(SR.TableItem_HorizontalAlign)
]
public virtual HorizontalAlign HorizontalAlign {
get {
if (ControlStyleCreated == false) {
return HorizontalAlign.NotSet;
}
return ((TableItemStyle)ControlStyle).HorizontalAlign;
}
set {
((TableItemStyle)ControlStyle).HorizontalAlign = value;
}
}
[
WebCategory("Accessibility"),
DefaultValue(TableRowSection.TableBody),
WebSysDescription(SR.TableRow_TableSection)
]
public virtual TableRowSection TableSection {
get {
object o = ViewState["TableSection"];
return((o == null) ? TableRowSection.TableBody : (TableRowSection)o);
}
set {
if (value < TableRowSection.TableHeader || value > TableRowSection.TableFooter) {
throw new ArgumentOutOfRangeException("value");
}
ViewState["TableSection"] = value;
if (value != TableRowSection.TableBody) {
Control parent = Parent;
if (parent != null) {
Table parentTable = parent as Table;
if (parentTable != null) {
parentTable.HasRowSections = true;
}
}
}
}
}
///
/// Indicates the vertical alignment of the content within the cell.
///
[
WebCategory("Layout"),
DefaultValue(VerticalAlign.NotSet),
WebSysDescription(SR.TableItem_VerticalAlign)
]
public virtual VerticalAlign VerticalAlign {
get {
if (ControlStyleCreated == false) {
return VerticalAlign.NotSet;
}
return ((TableItemStyle)ControlStyle).VerticalAlign;
}
set {
((TableItemStyle)ControlStyle).VerticalAlign = value;
}
}
///
///
/// A protected method. Creates a table item control style.
///
protected override Style CreateControlStyle() {
return new TableItemStyle(ViewState);
}
///
/// [To be supplied.]
///
protected override ControlCollection CreateControlCollection() {
return new CellControlCollection(this);
}
///
/// [To be supplied.]
///
protected class CellControlCollection : ControlCollection {
internal CellControlCollection (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 TableCell)
base.Add(child);
else
throw new ArgumentException(SR.GetString(SR.Cannot_Have_Children_Of_Type, "TableRow", 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 TableCell)
base.AddAt(index, child);
else
throw new ArgumentException(SR.GetString(SR.Cannot_Have_Children_Of_Type, "TableRow", child.GetType().Name.ToString(CultureInfo.InvariantCulture))); // throw an exception here
}
} // class CellControlCollection
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls {
using System;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Globalization;
using System.Web;
using System.Web.UI;
using System.Security.Permissions;
///
/// Encapsulates a row
/// within a table.
///
[
Bindable(false),
DefaultProperty("Cells"),
ParseChildren(true, "Cells"),
ToolboxItem(false)
]
[Designer("System.Web.UI.Design.WebControls.PreviewControlDesigner, " + AssemblyRef.SystemDesign)]
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public class TableRow : WebControl {
TableCellCollection cells;
///
///
/// Initializes a new instance of the class.
///
///
public TableRow() : base(HtmlTextWriterTag.Tr) {
PreventAutoID();
}
///
/// Indicates the table cell collection of the table
/// row. This property is read-only.
///
[
MergableProperty(false),
WebSysDescription(SR.TableRow_Cells),
PersistenceMode(PersistenceMode.InnerDefaultProperty)
]
public virtual TableCellCollection Cells {
get {
if (cells == null)
cells = new TableCellCollection(this);
return cells;
}
}
///
/// Indicates the horizontal alignment of the content within the table cells.
///
[
WebCategory("Layout"),
DefaultValue(HorizontalAlign.NotSet),
WebSysDescription(SR.TableItem_HorizontalAlign)
]
public virtual HorizontalAlign HorizontalAlign {
get {
if (ControlStyleCreated == false) {
return HorizontalAlign.NotSet;
}
return ((TableItemStyle)ControlStyle).HorizontalAlign;
}
set {
((TableItemStyle)ControlStyle).HorizontalAlign = value;
}
}
[
WebCategory("Accessibility"),
DefaultValue(TableRowSection.TableBody),
WebSysDescription(SR.TableRow_TableSection)
]
public virtual TableRowSection TableSection {
get {
object o = ViewState["TableSection"];
return((o == null) ? TableRowSection.TableBody : (TableRowSection)o);
}
set {
if (value < TableRowSection.TableHeader || value > TableRowSection.TableFooter) {
throw new ArgumentOutOfRangeException("value");
}
ViewState["TableSection"] = value;
if (value != TableRowSection.TableBody) {
Control parent = Parent;
if (parent != null) {
Table parentTable = parent as Table;
if (parentTable != null) {
parentTable.HasRowSections = true;
}
}
}
}
}
///
/// Indicates the vertical alignment of the content within the cell.
///
[
WebCategory("Layout"),
DefaultValue(VerticalAlign.NotSet),
WebSysDescription(SR.TableItem_VerticalAlign)
]
public virtual VerticalAlign VerticalAlign {
get {
if (ControlStyleCreated == false) {
return VerticalAlign.NotSet;
}
return ((TableItemStyle)ControlStyle).VerticalAlign;
}
set {
((TableItemStyle)ControlStyle).VerticalAlign = value;
}
}
///
///
/// A protected method. Creates a table item control style.
///
protected override Style CreateControlStyle() {
return new TableItemStyle(ViewState);
}
///
/// [To be supplied.]
///
protected override ControlCollection CreateControlCollection() {
return new CellControlCollection(this);
}
///
/// [To be supplied.]
///
protected class CellControlCollection : ControlCollection {
internal CellControlCollection (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 TableCell)
base.Add(child);
else
throw new ArgumentException(SR.GetString(SR.Cannot_Have_Children_Of_Type, "TableRow", 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 TableCell)
base.AddAt(index, child);
else
throw new ArgumentException(SR.GetString(SR.Cannot_Have_Children_Of_Type, "TableRow", child.GetType().Name.ToString(CultureInfo.InvariantCulture))); // throw an exception here
}
} // class CellControlCollection
}
}
// 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
- QuaternionAnimation.cs
- PointKeyFrameCollection.cs
- OlePropertyStructs.cs
- TextDecorationCollection.cs
- XmlSchemaAnnotated.cs
- PenLineCapValidation.cs
- MouseGestureValueSerializer.cs
- KeyFrames.cs
- SynchronousChannel.cs
- Size3D.cs
- WorkerProcess.cs
- BrowserCapabilitiesCompiler.cs
- EmptyEnumerator.cs
- __ConsoleStream.cs
- AppliedDeviceFiltersEditor.cs
- FrameworkElementFactory.cs
- DeclarativeCatalogPart.cs
- SqlMethodAttribute.cs
- DelegatingTypeDescriptionProvider.cs
- CodeLinePragma.cs
- ScriptHandlerFactory.cs
- ModifyActivitiesPropertyDescriptor.cs
- CardSpaceShim.cs
- AsyncCompletedEventArgs.cs
- DrawingState.cs
- PaperSource.cs
- CodeAttributeDeclaration.cs
- MethodCallTranslator.cs
- DbConnectionInternal.cs
- PowerModeChangedEventArgs.cs
- NetworkAddressChange.cs
- Effect.cs
- SafeFileMappingHandle.cs
- LinqDataSourceDeleteEventArgs.cs
- FactoryGenerator.cs
- ArrayWithOffset.cs
- SecurityPermission.cs
- Stacktrace.cs
- XamlSerializationHelper.cs
- HMACMD5.cs
- DataGridViewMethods.cs
- BuilderPropertyEntry.cs
- AspProxy.cs
- BigInt.cs
- ListViewPagedDataSource.cs
- PositiveTimeSpanValidatorAttribute.cs
- ParallelTimeline.cs
- StylusPointPropertyId.cs
- SafeViewOfFileHandle.cs
- AcceptorSessionSymmetricMessageSecurityProtocol.cs
- TextParagraph.cs
- OpCopier.cs
- UriSection.cs
- NegotiateStream.cs
- CompatibleComparer.cs
- DiscoveryDocumentLinksPattern.cs
- PassportIdentity.cs
- SecurityResources.cs
- QilNode.cs
- OdbcStatementHandle.cs
- BrowserDefinition.cs
- NetTcpBindingElement.cs
- ColumnBinding.cs
- AdornerDecorator.cs
- IdnMapping.cs
- XmlTextAttribute.cs
- KoreanLunisolarCalendar.cs
- _BasicClient.cs
- ComplexType.cs
- Activity.cs
- UseAttributeSetsAction.cs
- PtsContext.cs
- ObjectMemberMapping.cs
- AppDomainInfo.cs
- DataRelation.cs
- DataFormats.cs
- ElementAction.cs
- FutureFactory.cs
- QueueProcessor.cs
- SessionEndedEventArgs.cs
- Util.cs
- LinkConverter.cs
- ReadOnlyMetadataCollection.cs
- Soap.cs
- CodeAttributeArgument.cs
- AssemblyInfo.cs
- WindowsContainer.cs
- DataGridViewAccessibleObject.cs
- ProgressBarRenderer.cs
- BamlTreeMap.cs
- TemplateControlCodeDomTreeGenerator.cs
- TextBox.cs
- DataGridCellInfo.cs
- FixedPosition.cs
- UpdateExpressionVisitor.cs
- ExceptionCollection.cs
- counter.cs
- DoubleAnimationUsingPath.cs
- HttpModulesSection.cs
- SqlBinder.cs