System.ComponentModel.Design.UndoEngine Class

Specifies generic undo/redo functionality at design time.

See Also: UndoEngine Members


public abstract class UndoEngine : IDisposable


The System.ComponentModel.Design.UndoEngine abstract class provides a default implementation of undo functionality at design time. An undo unit represents a single unit of undoable work. This unit is added to a stack and the user can then walk the stack to undo each action. Undo units typically are designed to toggle, which means that calling undo twice returns the application to its starting state.

The System.ComponentModel.Design.UndoEngine class takes advantage of the following characteristics of objects running within the designer:

With these features, System.ComponentModel.Design.UndoEngine can fabricate any undo units it needs automatically.


Do not change property values directly. The System.ComponentModel.Design.UndoEngine class requires you to use the appropriate System.ComponentModel.TypeDescriptor to change property values.

System.ComponentModel.Design.UndoEngine monitors for change notifications to create undo units, and the units themselves consist of serialized object states. The following table shows the services that must be available when System.ComponentModel.Design.UndoEngine is created.


Saves property and object values for a component before and after a change is made.


Notifies the undo engine of changes made to components.


Used to track transactions.


Because the System.ComponentModel.Design.UndoEngine class requires System.ComponentModel.Design.Serialization.ComponentSerializationService and System.ComponentModel.Design.IComponentChangeService, it is available only at design time.

The undo engine tracks transactions and creates a single undo unit that encompasses a transaction. As a result, the undo engine has control over the duration of an undoable action. Also, because transactions can be named, undoable actions inherit their names from the current transaction. If no transaction is available and a change is reported, the undo engine creates an undo name based on the type of change (for example, "Change property 'Text'").


Namespace: System.ComponentModel.Design
Assembly: System.Design (in System.Design.dll)
Assembly Versions: