Skip to content

TComponentEnumerator

Implements IEnumerator for the TComponent class.

Declaration

Source position: classesh.inc line 2601

type

  TComponentEnumerator = class
  public
    constructor Create;
    function GetCurrent : TComponent;
    function MoveNext : Boolean;
    property Current: TComponent; {r}
  end;

Description

TComponentEnumerator implements the #rtl.system.IEnumerator interface for the TComponent class, so the TComponent class can be used in a for ... in loop over the TComponent.Components child components of the component. It is returned by the TComponent.GetEnumerator method of TComponent.

Properties

Member Visibility Description
Current read only public Current pointer in the list.

Methods

Member Visibility Description
Create public Initialize a new instance of TComponentEnumerator.
GetCurrent public Return the current pointer in the list.
MoveNext public Move the position of the enumerator to the next position in the children of the component.

See also

Name Description
TComponent Base class for all components that need owner-owned functionality.
TComponent.GetEnumerator Create an IEnumerator instance.
#rtl.system.IEnumerator Enumerator support interface.