Skip to main content

TdxRichEditCustomDocumentServer.CancelUpdate Method

Discards all pending changes made to the document server or its document after a BeginUpdate procedure call.

Declaration

procedure CancelUpdate;

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 procedure 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.

Call the CancelUpdate procedure instead of EndUpdate to 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