System.Classes.TWriter.WriteComponent

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure WriteComponent(Component: TComponent);

C++

void __fastcall WriteComponent(TComponent* Component);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Classes.pas
System.Classes.hpp
System.Classes TWriter

Description

Writes the component specified by Component to a stream.

Never call WriteComponent directly. WriteComponent is recursively called for each owned component in Root.

WriteComponent sets the csWriting state in Component's ComponentState property before calling the WriteState method of Component and clears the csWriting flag when WriteState returns.

Note: The sequence of events is as follows: the writer's WriteComponent method calls the Component's WriteState method, which calls the writer's WriteData method. That method writes the properties for each child component, then calls WriteComponent.

Because the Component's WriteState is virtual, it is the Component's only opportunity to prepare itself to be streamed (i.e. to consolidate its data.)

See Also