-
Notifications
You must be signed in to change notification settings - Fork 4
Write Lock
The Plugin API provides a write lock to coordinate changes being made by the plugin with changes made by Paratext. The typical sequence is:
- Plugin gets the data from Paratext
- Plugin gets the write lock for the data it intends to modify
- Plugin modifies the data
- Plugin writes the data to Paratext
- Plugin releases the write lock
The plugin uses the RequestWriteLock method to obtain a lock.
It uses the Dispose
method of the IWriteLock class to release it.
One of the parameters of the RequestWriteLock
is named releaseRequested
method and is an Action
.
The plugin provides this action, which is called when Paratext would like to lock the data the plugin has locked.
This allows the plugin to perform any steps necessary before releasing the lock.
The plugin must release the lock when requested (or Paratext will release it for the plugin).
The plugin will get a chance to finish the releaseRequested
action before Paratext steals the lock.