Skip to content
katherinejensen00 edited this page Jul 2, 2021 · 4 revisions

The Plugin API provides a write lock to coordinate changes being made by the plugin with changes made by Paratext. The typical sequence is:

  1. Plugin gets the data from Paratext
  2. Plugin gets the write lock for the data it intends to modify
  3. Plugin modifies the data
  4. Plugin writes the data to Paratext
  5. 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.

Clone this wiki locally