Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / TableRow.cs / 1305376 / TableRow.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Globalization; using System.Web; using System.Web.UI; using System.Web.Util; ////// [ Bindable(false), DefaultProperty("Cells"), ParseChildren(true, "Cells"), ToolboxItem(false) ] [Designer("System.Web.UI.Design.WebControls.PreviewControlDesigner, " + AssemblyRef.SystemDesign)] public class TableRow : WebControl { TableCellCollection cells; ///Encapsulates a row /// within a table. ////// public TableRow() : base(HtmlTextWriterTag.Tr) { PreventAutoID(); } ////// Initializes a new instance of the ///class. /// /// [ 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 table cell collection of the table /// row. This property is read-only. ////// [ 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; } } public override bool SupportsDisabledAttribute { get { return RenderingCompatibility < VersionUtil.Framework40; } } [ 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 horizontal alignment of the content within the table cells. ////// [ 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; } } ///Indicates the vertical alignment of the content within the cell. ////// /// protected override Style CreateControlStyle() { return new TableItemStyle(ViewState); } ///A protected method. Creates a table item control style. ////// protected override ControlCollection CreateControlCollection() { return new CellControlCollection(this); } ///[To be supplied.] ////// protected class CellControlCollection : ControlCollection { internal CellControlCollection (Control owner) : base(owner) { } ///[To be supplied.] ////// 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 end of the array. /// 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. //------------------------------------------------------------------------------ //Adds the specified ///object to the collection. The new control is added /// to the array at the specified index location. // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Globalization; using System.Web; using System.Web.UI; using System.Web.Util; ////// [ Bindable(false), DefaultProperty("Cells"), ParseChildren(true, "Cells"), ToolboxItem(false) ] [Designer("System.Web.UI.Design.WebControls.PreviewControlDesigner, " + AssemblyRef.SystemDesign)] public class TableRow : WebControl { TableCellCollection cells; ///Encapsulates a row /// within a table. ////// public TableRow() : base(HtmlTextWriterTag.Tr) { PreventAutoID(); } ////// Initializes a new instance of the ///class. /// /// [ 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 table cell collection of the table /// row. This property is read-only. ////// [ 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; } } public override bool SupportsDisabledAttribute { get { return RenderingCompatibility < VersionUtil.Framework40; } } [ 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 horizontal alignment of the content within the table cells. ////// [ 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; } } ///Indicates the vertical alignment of the content within the cell. ////// /// protected override Style CreateControlStyle() { return new TableItemStyle(ViewState); } ///A protected method. Creates a table item control style. ////// protected override ControlCollection CreateControlCollection() { return new CellControlCollection(this); } ///[To be supplied.] ////// protected class CellControlCollection : ControlCollection { internal CellControlCollection (Control owner) : base(owner) { } ///[To be supplied.] ////// 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 end of the array. /// 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.Adds the specified ///object to the collection. The new control is added /// to the array at the specified index location.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ChtmlTextWriter.cs
- DetailsViewInsertedEventArgs.cs
- QuadraticBezierSegment.cs
- ReachBasicContext.cs
- SAPIEngineTypes.cs
- DiscoveryInnerClientAdhocCD1.cs
- ToolStripAdornerWindowService.cs
- StaticFileHandler.cs
- _SpnDictionary.cs
- MachineKeyValidationConverter.cs
- PropertyChangedEventManager.cs
- GroupItemAutomationPeer.cs
- DesignerAttribute.cs
- SizeKeyFrameCollection.cs
- AndCondition.cs
- XmlTypeAttribute.cs
- SimpleFileLog.cs
- ClientTarget.cs
- InputLanguageCollection.cs
- TaskHelper.cs
- SByte.cs
- DetectRunnableInstancesTask.cs
- ToggleProviderWrapper.cs
- WS2007FederationHttpBindingCollectionElement.cs
- HierarchicalDataBoundControl.cs
- WebEvents.cs
- MultiSelector.cs
- OptimizedTemplateContent.cs
- TargetParameterCountException.cs
- FaultReasonText.cs
- ResumeStoryboard.cs
- IndependentlyAnimatedPropertyMetadata.cs
- ObjectNotFoundException.cs
- ReflectionHelper.cs
- PrinterResolution.cs
- UITypeEditor.cs
- PatternMatcher.cs
- FixedDocument.cs
- XPathAncestorIterator.cs
- HybridDictionary.cs
- AutoGeneratedField.cs
- ThreadExceptionEvent.cs
- SmtpNegotiateAuthenticationModule.cs
- TextTrailingWordEllipsis.cs
- CorePropertiesFilter.cs
- LogEntry.cs
- EntityDataSourceChangedEventArgs.cs
- CopyOnWriteList.cs
- PageSetupDialog.cs
- DbSourceCommand.cs
- GPRECT.cs
- safePerfProviderHandle.cs
- Literal.cs
- ColorContextHelper.cs
- SQLInt32.cs
- MissingFieldException.cs
- BitmapScalingModeValidation.cs
- Mapping.cs
- DigitalSignature.cs
- PerformanceCounterPermissionEntry.cs
- AccessorTable.cs
- SystemFonts.cs
- UnsafeNativeMethods.cs
- CryptoConfig.cs
- DoubleConverter.cs
- dataobject.cs
- CodeValidator.cs
- GradientStop.cs
- QilVisitor.cs
- SEHException.cs
- MouseGestureConverter.cs
- CollaborationHelperFunctions.cs
- SqlServices.cs
- GenerateTemporaryTargetAssembly.cs
- AssemblyAttributes.cs
- TrackBarRenderer.cs
- FormViewPagerRow.cs
- InteropEnvironment.cs
- DetailsViewInsertedEventArgs.cs
- RequestCacheValidator.cs
- Delay.cs
- DataObjectSettingDataEventArgs.cs
- AutomationPatternInfo.cs
- AdditionalEntityFunctions.cs
- Odbc32.cs
- ContractReference.cs
- StylusDevice.cs
- FixedSOMImage.cs
- ConfigurationManager.cs
- RawStylusInputCustomData.cs
- Exception.cs
- LambdaCompiler.Address.cs
- FlowPanelDesigner.cs
- SelectionItemPattern.cs
- BindingObserver.cs
- PropertyGridEditorPart.cs
- ListViewPagedDataSource.cs
- InteropAutomationProvider.cs
- DeviceContext2.cs
- ButtonFieldBase.cs