Call Dispose when you are finished using the UndoManager. The Dispose method leaves the UndoManager in an unusable state. After calling Dispose, you must release all references to the UndoManager so the garbage collector can reclaim the memory that the UndoManager was occupying.
For more information, see "IDisposable interface" in the .NET documentation.