Skip to content

TComponentEnumerator

[Properties (by Name)][Methods (by Name)][Events (by Name)]

Implements IEnumerator for the TComponent class.

Declaration

Source position: classesh.inc line 2029

Type
  TComponentEnumerator = class
  private
    FComponent : TComponent;
    FPosition : Integer;
  public
    constructor Create(AComponent: TComponent);
    function GetCurrent : TComponent;
    function MoveNext : Boolean;
    Current : TComponent;
  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.

Members

Member Type Visibility Description
Create Method public Initialize a new instance of TComponentEnumerator
Current Property public Current pointer in the list
FComponent Field private
FPosition Field private
GetCurrent Method public Return the current pointer in the list
MoveNext Method public Move the position of the enumerator to the next position in the children of the component.

Inheritance

Class Description
TComponentEnumerator Implements IEnumerator for the TComponent class.

See also

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