Skip to main content

TdxRichEditCustomDocumentServer.BeginUpdate Method

Postpones all changes made to the document server or its opened document until an EndUpdate procedure call.

Declaration

procedure BeginUpdate;

Remarks

Every time you change the document server state or edit the opened document, the server sends notifications to all its listeners (such as the document model’s internal settings, for instance) to apply the change. You can enclose the code that performs multiple changes between BeginUpdate and EndUpdate procedure calls to improve performance.

A BeginUpdate call disables notifications and postpones all changes until an EndUpdate call. The IsUpdateLocked property returns True while the change notifications are disabled. A consequent EndUpdate call re-enables change notifications, applies all the changes made after a BeginUpdate call, and sends the corresponding notifications in a batch.

You can call CancelUpdate instead of the EndUpdate procedure to re-enable change notifications but discard all pending changes and notifications. This is particularly useful if you need to implement complex atomic operations on the document server or the opened document.

Note

Ensure that every BeginUpdate call is followed by an EndUpdate or CancelUpdate call, even if an exception occurs.

See Also