Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------- // // 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 { ///index is less than zero -or-index is equal to or greater than Count. ////// 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
- PlatformNotSupportedException.cs
- Splitter.cs
- NameValuePair.cs
- ValueSerializerAttribute.cs
- OracleConnectionFactory.cs
- CalendarTable.cs
- DesignerRegionCollection.cs
- DataSourceCacheDurationConverter.cs
- Events.cs
- ExtentKey.cs
- Symbol.cs
- PathFigureCollectionConverter.cs
- BreakRecordTable.cs
- BitVector32.cs
- OracleParameter.cs
- PathBox.cs
- PackagePart.cs
- GeneralTransformGroup.cs
- EndpointBehaviorElementCollection.cs
- Int32Rect.cs
- BinaryObjectInfo.cs
- OleDbDataAdapter.cs
- NullRuntimeConfig.cs
- XmlSchemaException.cs
- DirectionalLight.cs
- OleDbReferenceCollection.cs
- HttpDebugHandler.cs
- InputDevice.cs
- RequestCacheEntry.cs
- PropertySourceInfo.cs
- PropertyTab.cs
- WebPartDescriptionCollection.cs
- Membership.cs
- SchemaObjectWriter.cs
- WizardForm.cs
- ThaiBuddhistCalendar.cs
- XmlDataSourceView.cs
- AddInPipelineAttributes.cs
- FeatureAttribute.cs
- ItemCheckEvent.cs
- DBSchemaRow.cs
- CompositionCommandSet.cs
- RawKeyboardInputReport.cs
- DynamicPropertyHolder.cs
- DataGridViewRowsAddedEventArgs.cs
- XmlHelper.cs
- AssemblyName.cs
- QueryTask.cs
- FilterEventArgs.cs
- KeyValuePair.cs
- CodeNamespaceImportCollection.cs
- Point.cs
- HandleRef.cs
- ScrollChrome.cs
- ExpressionVisitorHelpers.cs
- XmlUrlResolver.cs
- AuthenticatedStream.cs
- SerializerProvider.cs
- KeyboardEventArgs.cs
- XPathItem.cs
- Mapping.cs
- ThreadExceptionDialog.cs
- XmlDsigSep2000.cs
- ItemType.cs
- BitmapVisualManager.cs
- XmlSchemaValidator.cs
- MsmqIntegrationReceiveParameters.cs
- TemplateComponentConnector.cs
- NumericUpDownAcceleration.cs
- MsmqIntegrationChannelFactory.cs
- SecurityRuntime.cs
- ConnectionPointCookie.cs
- CodeDirectoryCompiler.cs
- SqlClientPermission.cs
- TypeElement.cs
- ColorTransform.cs
- AbsoluteQuery.cs
- RegexCapture.cs
- XmlSchemaGroup.cs
- CatalogZone.cs
- HeaderUtility.cs
- RSAOAEPKeyExchangeDeformatter.cs
- XmlTypeAttribute.cs
- TableRowCollection.cs
- LostFocusEventManager.cs
- SwitchLevelAttribute.cs
- BackStopAuthenticationModule.cs
- SettingsPropertyNotFoundException.cs
- WebBrowserContainer.cs
- TcpAppDomainProtocolHandler.cs
- HtmlInputButton.cs
- ListViewItemCollectionEditor.cs
- DesignerActionUIService.cs
- UInt16Storage.cs
- UriTemplateClientFormatter.cs
- InitializerFacet.cs
- FileSystemInfo.cs
- MemberInitExpression.cs
- TimelineCollection.cs
- HttpPostLocalhostServerProtocol.cs