Skip to content
GR32>TNotifiablePersistentClass

TNotifiablePersistent

Persistent object subclass that manages change notifications (`OnChange` events) and change batching (`BeginUpdate` / `EndUpdate`).

Inheritance:TObject > TPersistent > TPlainInterfacedPersistent > TNotifiablePersistent

Declaration

pascal
TNotifiablePersistent = class(TPlainInterfacedPersistent)

Description ​

TNotifiablePersistent extends TPlainInterfacedPersistent by adding a deferred notification and update lock mechanism.

It allows callers to batch multiple state modifications between calls to BeginUpdate and EndUpdate (or BeginLockUpdate and EndLockUpdate), postponing (or disabling) OnChange events until the batch operation completes.

Methods ​

NameDescription
BeginUpdateIncrements the update counter to defer change notifications during batch modifications.
EndUpdateDecrements the update counter and triggers Changed if modifications occurred while suspended.
BeginLockUpdateIncrements the lock update counter.
EndLockUpdateDecrements the lock update counter.
ChangedTriggers the change notification flow or marks the object as modified if updates are suspended.
DoChangedProtected virtual method that executes the OnChange event handler.

Properties ​

NameTypeScopeDescription
UpdateCountIntegerProtectedCurrent nest level of BeginUpdate / EndUpdate blocks.
LockUpdateCountIntegerProtectedCurrent nest level of BeginLockUpdate / EndLockUpdate blocks.
ModifiedBooleanProtectedIndicates whether changes occurred while UpdateCount > 0.

Events ​

NameTypeDescription
OnChangeTNotifyEventFired when the object state changes and updates are not suspended.