Version

AddChange(UndoUnit) Method

Adds an UndoUnit to the history.
Syntax
'Declaration
 
Public Overloads Sub AddChange( _
   ByVal unit As UndoUnit _
) 
public void AddChange( 
   UndoUnit unit
)

Parameters

unit
The unit to add to the history.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionThe 'unit' cannot be null.
Remarks

This overload takes the provided unit and adds it to either the undo or redo history stack based on the current state of the UndoManager. For example while executing an Undo (i.e. IsPerformingUndo is true), change units will be added to the redo stack.

Note: An undo unit is not automatically moved from the undo stack to the redo stack or vice versa. It is expected that either the change that the UndoUnit makes (e.g. a property change) will result in a new change being added to the UndoManager or that the unit itself will add a unit (even itself) to the UndoManager. The AddChange(String,String,Action,Action,Object) is one such example of the latter. The UndoUnit created by that overload will add itself back into the UndoManager if the associated undo or redo delegate is successful.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also