O'Reilly logo

Expert C# 2008 Business Objects by Rockford Lhotka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. N-Level Undo

There are scenarios where an application requires the ability to undo changes made to an object. Data binding is one example because implementing the IEditableObject interface requires that an object be able to take a snapshot of its state, be edited, and then be able to return its state to that snapshot later. Another example is where the UI has a Cancel button that doesn't close the form or page, in which case the user expects that clicking Cancel will revert the form's data (and thus the business object) to a previous state.

Implementing an undo feature is challenging, especially when you consider parent-child object relationships. When undoing changes to an Invoice object, for example, it is necessary to remove all ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required