csWriting
csWriting = 2
Example
function IsWritingProperties(const State: TComponentState): Boolean;
begin
Result := csWriting in State;
end;
Usage
csWriting marks the component-stream phase in which the framework is writing property values.
Additional Technical Info
csWriting is member ordinal 2 of the component-state element enumeration used by TComponentState. It reports that Delphi's component streaming framework is writing published property values.
Code reached during this phase should avoid unrelated mutations or I/O that would make serialization re-entrant or inconsistent. Current Velox action code uses csWriting, csReading and csLoading together to defer state-sensitive work.
The flag does not mean an ordinary file, stream, database or HTTP body is being written. It is framework-controlled, read-only and transient. The example is source-reviewed only; no component was serialized.
External references
- Embarcadero TComponentState - writing-state definition.
- Free Pascal TComponentState - compatible flag.