Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / HtmlControls / HtmlTableCellCollection.cs / 1 / HtmlTableCellCollection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
* HtmlTableCellCollection.cs
*
* Copyright (c) 2000 Microsoft Corporation
*/
namespace System.Web.UI.HtmlControls {
using System.Runtime.InteropServices;
using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Security.Permissions;
///
///
/// The contains all of the table
/// cells, both <td> and <th> elements, found within an
/// server control.
///
///
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public sealed class HtmlTableCellCollection : ICollection {
///
///
///
private HtmlTableRow owner;
internal HtmlTableCellCollection(HtmlTableRow owner) {
this.owner = owner;
}
/*
* The number of cells in the row.
*/
///
///
/// Gets the number of items in the
/// collection.
///
///
public int Count {
get {
if (owner.HasControls())
return owner.Controls.Count;
return 0;
}
}
///
///
/// Gets an control from an
/// control thorugh the cell's ordinal index value.
///
///
public HtmlTableCell this[int index]
{
get {
return(HtmlTableCell)owner.Controls[index];
}
}
///
///
/// Adds the specified control to the end of the
/// collection.
///
///
public void Add(HtmlTableCell cell) {
Insert(-1, cell);
}
///
///
/// Adds an control to a specified location in the
/// collection.
///
///
public void Insert(int index, HtmlTableCell cell) {
owner.Controls.AddAt(index, cell);
}
///
///
/// Deletes all
/// controls from the collection.
///
///
public void Clear() {
if (owner.HasControls())
owner.Controls.Clear();
}
/*
* Returns an enumerator that enumerates over the cells in a table row in order.
*/
///
///
public IEnumerator GetEnumerator() {
return owner.Controls.GetEnumerator();
}
///
///
public void CopyTo(Array array, int index) {
for (IEnumerator e = this.GetEnumerator(); e.MoveNext();)
array.SetValue(e.Current, index++);
}
///
///
public Object SyncRoot {
get { return this;}
}
///
///
public bool IsReadOnly {
get { return false;}
}
///
///
public bool IsSynchronized {
get { return false;}
}
///
///
/// Deletes the specified control from the
/// collection.
///
///
public void Remove(HtmlTableCell cell) {
owner.Controls.Remove(cell);
}
///
///
/// Deletes the control at the specified index
/// location from the collection.
///
///
public void RemoveAt(int index) {
owner.Controls.RemoveAt(index);
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WorkflowHostingEndpoint.cs
- ShaderEffect.cs
- ModifyActivitiesPropertyDescriptor.cs
- ToolStripDropDownButton.cs
- BitStream.cs
- MouseOverProperty.cs
- Transactions.cs
- SimplePropertyEntry.cs
- EnterpriseServicesHelper.cs
- ResolvedKeyFrameEntry.cs
- XPathSelectionIterator.cs
- DataGrid.cs
- IndexingContentUnit.cs
- RpcCryptoRequest.cs
- BaseUriHelper.cs
- Transform.cs
- XmlRawWriterWrapper.cs
- Run.cs
- QuaternionRotation3D.cs
- HealthMonitoringSectionHelper.cs
- _ConnectionGroup.cs
- EmptyElement.cs
- PageThemeParser.cs
- WebProxyScriptElement.cs
- CFStream.cs
- EncoderBestFitFallback.cs
- CacheOutputQuery.cs
- List.cs
- XmlSchemaNotation.cs
- EncoderParameter.cs
- RequestDescription.cs
- SmtpReplyReader.cs
- Barrier.cs
- MsmqInputSessionChannel.cs
- Convert.cs
- XmlEntityReference.cs
- XmlHierarchicalDataSourceView.cs
- WebPartCloseVerb.cs
- HtmlInputRadioButton.cs
- OleDbEnumerator.cs
- WindowsToolbar.cs
- DateTimeFormat.cs
- UIntPtr.cs
- ForEach.cs
- TypeDescriptionProvider.cs
- XmlElement.cs
- RsaSecurityToken.cs
- DataControlFieldCell.cs
- ReadOnlyObservableCollection.cs
- TileBrush.cs
- HostingEnvironmentException.cs
- EncoderParameter.cs
- ResourceIDHelper.cs
- X509InitiatorCertificateClientElement.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- DrawingAttributes.cs
- TextModifierScope.cs
- GridViewUpdateEventArgs.cs
- XmlSignatureManifest.cs
- InternalConfigEventArgs.cs
- CriticalHandle.cs
- BooleanFunctions.cs
- ProfileBuildProvider.cs
- DataGrid.cs
- ModuleBuilderData.cs
- ObjectDataSourceDisposingEventArgs.cs
- VisualStyleInformation.cs
- StylusPointCollection.cs
- WsdlInspector.cs
- XPathSingletonIterator.cs
- MessageHeaderDescription.cs
- WriterOutput.cs
- ParseNumbers.cs
- DynamicEndpointElement.cs
- SharedPerformanceCounter.cs
- DataGridTemplateColumn.cs
- _CommandStream.cs
- NavigatorInput.cs
- TogglePattern.cs
- X509PeerCertificateAuthentication.cs
- BuildProviderCollection.cs
- DateTimeConverter.cs
- IsolatedStorageFileStream.cs
- bidPrivateBase.cs
- wmiprovider.cs
- BaseCollection.cs
- ProtocolsSection.cs
- InputReferenceExpression.cs
- EndPoint.cs
- TreeView.cs
- SqlConnectionPoolProviderInfo.cs
- GridViewCommandEventArgs.cs
- RequestCachePolicyConverter.cs
- TrayIconDesigner.cs
- RuntimeArgument.cs
- SystemUnicastIPAddressInformation.cs
- ParserStack.cs
- EditorBrowsableAttribute.cs
- IndexedString.cs
- RelationshipSet.cs