How to: Undo and Redo Changes Made to the Store

The store has an UndoManager that you can use to undo and redo changes to the store.

To undo changes made to the store

  • Use the Undo method of the UndoManager member of the store.

To redo changes made to the store

  • Use the Redo method of the UndoManager member of the store.

Note Note

You must undo a change before you can redo a change.

The following example changes the contents of the store in a transaction, commits the transaction, and then undoes the changes.

Transaction t = store.TransactionManager.BeginTransaction("MakeChanges");
// Do some actions that change the store
t.Commit();

// Undo any changes made to the store in the transaction
store.UndoManager.Undo(t.Id);

// This would cancel the undo, so changes from the transaction are made
// store.UndoManager.Redo(t.Id);

Show: