System.ComponentModel.ComponentCollection Class

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

See Also: ComponentCollection Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public class ComponentCollection : ReadOnlyCollectionBase

Remarks

This collection inherits from ReadOnlyCollectionBase. The only way to add System.ComponentModel.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 System.ComponentModel.IComponent at the specified collection index. The ComponentCollection.CopyTo(IComponent[], int) method copies the contents of the collection to a specified array, beginning writing to the array at the specified index.

Requirements

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