NanoByte.Common  2.10.5
Undo system

The NanoByte.Common.Undo namespace provides a framework for adding undo/redo functionality to your applications.

Commands

Commands that can be executed and also undone are represented using the IUndoCommand interface.

This library provides a number of implementations for common use cases such as SetValueCommand and AddToCollection, but you can also implement your own.

Executors

Methods that wish to execute IUndoCommands should take an ICommandExecutor as an input parameter.
To execute an IUndoCommand pass it to the ICommandExecutor.Execute() method. This will then internally call IUndoCommand.Execute() and record the command for later undo operations.

The class CommandManager implements the ICommandExecutor interface. You can expose this classes .Undo() and .Redo() methods to your users in your GUI.