System.ComponentModel.ComponentCollection Class

Provides a read-only container for a collection of IComponent objects.

See Also: ComponentCollection


public class ComponentCollection : ReadOnlyCollectionBase


This collection inherits from ReadOnlyCollectionBase. The only way to add IComponent objects to this collection is to use the class constructor.

This collection provides two indexer properties, a string indexer and an integer indexer. The string indexer property returns a component in the collection by name if the IComponent.Site property of a component in the collection is not null and the ISite.Name property of the IComponent.Site property of the component matches the specified string. The integer indexer property returns the IComponent at the specified collection index. The ComponentCollection.CopyTo(IComponent[],Int32) method copies the contents of the collection to a specified array, beginning writing to the array at the specified index.


Namespace: System.ComponentModel
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0,,

The members of System.ComponentModel.ComponentCollection are listed below.

See Also: ReadOnlyCollectionBase

Public Constructors

Initializes a new instance of the ComponentCollection class using the specified array of components.

Public Properties

default property
default property

Public Methods

CopyTo(IComponent[], Int32)

Copies the entire collection to an array, starting writing at the specified array index.