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 ​
| Name | Description |
|---|---|
| BeginUpdate | Increments the update counter to defer change notifications during batch modifications. |
| EndUpdate | Decrements the update counter and triggers Changed if modifications occurred while suspended. |
| BeginLockUpdate | Increments the lock update counter. |
| EndLockUpdate | Decrements the lock update counter. |
| Changed | Triggers the change notification flow or marks the object as modified if updates are suspended. |
| DoChanged | Protected virtual method that executes the OnChange event handler. |
Properties ​
| Name | Type | Scope | Description |
|---|---|---|---|
| UpdateCount | Integer | Protected | Current nest level of BeginUpdate / EndUpdate blocks. |
| LockUpdateCount | Integer | Protected | Current nest level of BeginLockUpdate / EndLockUpdate blocks. |
| Modified | Boolean | Protected | Indicates whether changes occurred while UpdateCount > 0. |
Events ​
| Name | Type | Description |
|---|---|---|
| OnChange | TNotifyEvent | Fired when the object state changes and updates are not suspended. |