Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / TableColumnCollection.cs / 1305600 / TableColumnCollection.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: TableColumnCollection.cs // // Description: Collection of TableColumn objects. // //--------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using MS.Internal.Documents; namespace System.Windows.Documents { ////// A TableColumnCollection is an ordered collection of TableColumns. /// ////// TableColumnCollection provides public access for TableColumns /// reading and manipulating. /// public sealed class TableColumnCollection : IList, IList { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors internal TableColumnCollection(Table owner) { _columnCollection = new TableColumnCollectionInternal(owner); } #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods /// /// ////// /// ////// /// ////// /// ////// /// public void CopyTo(Array array, int index) { _columnCollection.CopyTo(array, index); } /// /// Strongly typed version of ICollection.CopyTo. /// ////// ////// /// ////// /// ////// /// /// /// public void CopyTo(TableColumn[] array, int index) { _columnCollection.CopyTo(array, index); } ////// /// IEnumerator IEnumerable.GetEnumerator() { return _columnCollection.GetEnumerator(); } ////// /// IEnumerator/// IEnumerable .GetEnumerator() { return ((IEnumerable )_columnCollection).GetEnumerator(); } /// /// Appends a TableColumn to the end of the TableColumnCollection. /// /// The TableColumn to be added to the end of the TableColumnCollection. ///The TableColumnCollection index at which the TableColumn has been added. ///Adding a null is prohibited. ////// If the ///item value is null. ////// If the new child already has a parent. /// public void Add(TableColumn item) { _columnCollection.Add(item); } ////// Removes all elements from the TableColumnCollection. /// ////// Count is set to zero. Capacity remains unchanged. /// To reset the capacity of the TableColumnCollection, call TrimToSize /// or set the Capacity property directly. /// public void Clear() { _columnCollection.Clear(); } ////// Determines whether a TableColumn is in the TableColumnCollection. /// /// The TableColumn to locate in the TableColumnCollection. /// The value can be a null reference. ///true if TableColumn is found in the TableColumnCollection; /// otherwise, false. public bool Contains(TableColumn item) { return _columnCollection.Contains(item); } ////// Returns the zero-based index of the TableColumn. If the TableColumn is not /// in the TableColumnCollection, -1 is returned. /// /// The TableColumn to locate in the TableColumnCollection. public int IndexOf(TableColumn item) { return _columnCollection.IndexOf(item); } ////// Inserts a TableColumn into the TableColumnCollection at the specified index. /// /// The zero-based index at which value should be inserted. /// The TableColumn to insert. ////// ///index c> is less than zero. /// -or- ///index is greater than Count. ////// If the ///item value is null. ////// If Count already equals Capacity, the capacity of the /// TableColumnCollection is increased before the new TableColumn is inserted. /// /// If index is equal to Count, TableColumn is added to the /// end of TableColumnCollection. /// /// The TableColumns that follow the insertion point move down to /// accommodate the new TableColumn. The indexes of the TableColumns that are /// moved are also updated. /// public void Insert(int index, TableColumn item) { _columnCollection.Insert(index, item); } ////// Removes the specified TableColumn from the TableColumnCollection. /// /// The TableColumn to remove from the TableColumnCollection. ////// If the ///item value is null. ////// If the specified TableColumn is not in this collection. /// ////// The TableColumns that follow the removed TableColumn move up to occupy /// the vacated spot. The indices of the TableColumns that are moved /// also updated. /// public bool Remove(TableColumn item) { return _columnCollection.Remove(item); } ////// Removes the TableColumn at the specified index. /// /// The zero-based index of the TableColumn to remove. ////// ///index is less than zero /// - or - ///index is equal or greater than count. ////// The TableColumns that follow the removed TableColumn move up to occupy /// the vacated spot. The indices of the TableColumns that are moved /// also updated. /// public void RemoveAt(int index) { _columnCollection.RemoveAt(index); } ////// Removes a range of TableColumns from the TableColumnCollection. /// /// The zero-based index of the range /// of TableColumns to remove /// The number of TableColumns to remove. ////// ///index is less than zero. /// -or- ///count is less than zero. ////// ///index andcount do not denote a valid range of TableColumns in the TableColumnCollection. ////// The TableColumns that follow the removed TableColumns move up to occupy /// the vacated spot. The indices of the TableColumns that are moved are /// also updated. /// public void RemoveRange(int index, int count) { _columnCollection.RemoveRange(index, count); } ////// Sets the capacity to the actual number of elements in the TableColumnCollection. /// ////// This method can be used to minimize a TableColumnCollection's memory overhead /// if no new elements will be added to the collection. /// /// To completely clear all elements in a TableColumnCollection, call the Clear method /// before calling TrimToSize. /// public void TrimToSize() { _columnCollection.TrimToSize(); } #endregion Public Methods //-------------------------------------------------------------------- // // IList Members // //-------------------------------------------------------------------- #region IList Members int IList.Add(object value) { TableColumn item = value as TableColumn; if (item == null) { throw new ArgumentException(SR.Get(SRID.TableCollectionElementTypeExpected, typeof(TableColumn).Name), "value"); } return ((IList)_columnCollection).Add(value); } void IList.Clear() { this.Clear(); } bool IList.Contains(object value) { return ((IList)_columnCollection).Contains(value); } int IList.IndexOf(object value) { return ((IList)_columnCollection).IndexOf(value); } void IList.Insert(int index, object value) { ((IList)_columnCollection).Insert(index, value); } bool IList.IsFixedSize { get { return ((IList)_columnCollection).IsFixedSize; } } bool IList.IsReadOnly { get { return ((IList)_columnCollection).IsReadOnly; } } void IList.Remove(object value) { ((IList)_columnCollection).Remove(value); } void IList.RemoveAt(int index) { ((IList)_columnCollection).RemoveAt(index); } object IList.this[int index] { get { return ((IList)_columnCollection)[index]; } set { ((IList)_columnCollection)[index] = value; } } #endregion IList Members //----------------------------------------------------- // // Public Properties // //------------------------------------------------------ #region Public Properties ////// public int Count { get { return _columnCollection.Count; } } ////// /// public bool IsReadOnly // bool IList.IsReadOnly {get;}; bool ICollection/// /// .IsReadOnly {get;} { get { return _columnCollection.IsReadOnly; } } /// /// public bool IsSynchronized { get { return _columnCollection.IsSynchronized; } } ////// /// Always returns false. /// ////// public object SyncRoot { get { return _columnCollection.SyncRoot; } } ////// /// Gets or sets the number of elements that the TableColumnCollection can contain. /// ////// The number of elements that the TableColumnCollection can contain. /// ////// Capacity is the number of elements that the TableColumnCollection is capable of storing. /// Count is the number of Visuals that are actually in the TableColumnCollection. /// /// Capacity is always greater than or equal to Count. If Count exceeds /// Capacity while adding elements, the capacity of the TableColumnCollection is increased. /// /// By default the capacity is 8. /// ////// Capacity is set to a value that is less than Count. /// ///public int Capacity { get { return _columnCollection.PrivateCapacity; } set { _columnCollection.PrivateCapacity = value; } } /// /// Indexer for the TableColumnCollection. Gets the TableColumn stored at the /// zero-based index of the TableColumnCollection. /// ///This property provides the ability to access a specific TableColumn in the /// TableColumnCollection by using the following systax: ///TableColumn myTableColumn = myTableColumnCollection[index] . ////// public TableColumn this[int index] { get { return _columnCollection[index]; } set { _columnCollection[index] = value; } } #endregion Public Properties private TableColumnCollectionInternal _columnCollection; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.index is less than zero -or-index is equal to or greater than Count. ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ClientSponsor.cs
- DoubleStorage.cs
- XmlWhitespace.cs
- TcpDuplicateContext.cs
- FunctionDetailsReader.cs
- ImageListStreamer.cs
- Char.cs
- WebPartConnectionsDisconnectVerb.cs
- GlobalProxySelection.cs
- ServiceElementCollection.cs
- ItemsPanelTemplate.cs
- JsonGlobals.cs
- JournalEntryListConverter.cs
- MappingException.cs
- TagPrefixCollection.cs
- EditorPartChrome.cs
- ContextMenuStrip.cs
- PromptEventArgs.cs
- TabletCollection.cs
- TemplateComponentConnector.cs
- EngineSiteSapi.cs
- ConstrainedDataObject.cs
- RTLAwareMessageBox.cs
- Html32TextWriter.cs
- WindowsProgressbar.cs
- LinkedList.cs
- RadioButtonPopupAdapter.cs
- WorkflowInstanceSuspendedRecord.cs
- SQLBinaryStorage.cs
- GeometryConverter.cs
- Size.cs
- CursorConverter.cs
- BStrWrapper.cs
- CapiSymmetricAlgorithm.cs
- ProjectionCamera.cs
- CellParagraph.cs
- SQLBinaryStorage.cs
- CollectionChangedEventManager.cs
- SslSecurityTokenParameters.cs
- ImageMap.cs
- AndCondition.cs
- TypeToTreeConverter.cs
- SafeRightsManagementSessionHandle.cs
- ImportCatalogPart.cs
- ColumnClickEvent.cs
- XmlSchemaCompilationSettings.cs
- SwitchElementsCollection.cs
- MbpInfo.cs
- LayoutDump.cs
- RegistrySecurity.cs
- DesignerCapabilities.cs
- FrameworkEventSource.cs
- Rights.cs
- entityreference_tresulttype.cs
- DataTableReader.cs
- TcpProcessProtocolHandler.cs
- InternalControlCollection.cs
- GridErrorDlg.cs
- TextEditorParagraphs.cs
- LocalBuilder.cs
- PerfProviderCollection.cs
- ObjectMemberMapping.cs
- MenuItemStyleCollectionEditor.cs
- LockingPersistenceProvider.cs
- DependencyPropertyHelper.cs
- InvalidEnumArgumentException.cs
- ArcSegment.cs
- DataListGeneralPage.cs
- COM2ExtendedTypeConverter.cs
- CodeAttributeDeclarationCollection.cs
- TrackingServices.cs
- ToolStripRendererSwitcher.cs
- HotCommands.cs
- PageParser.cs
- EnumType.cs
- InheritanceService.cs
- X509CertificateStore.cs
- XmlSerializerSection.cs
- NotSupportedException.cs
- ContentElement.cs
- TreeNode.cs
- Double.cs
- PresentationAppDomainManager.cs
- DataGridColumnFloatingHeader.cs
- DataGridViewColumnHeaderCell.cs
- TemporaryBitmapFile.cs
- IndicFontClient.cs
- TableAdapterManagerGenerator.cs
- ConnectionInterfaceCollection.cs
- DependencyPropertyConverter.cs
- ReflectionTypeLoadException.cs
- XPathQilFactory.cs
- ToolStripDesignerAvailabilityAttribute.cs
- XmlDataCollection.cs
- Guid.cs
- counter.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- DLinqAssociationProvider.cs
- SimpleMailWebEventProvider.cs
- unitconverter.cs