How to implement Undo and Redo

Technical assistance & information for projects
Post Reply
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

How to implement Undo and Redo

Post by Neo » Wed Apr 21, 2010 4:17 pm

Under programming techniques, this is called memento design pattern which we used to implement "undo" & “Redo” functionality on the application.

In simple terms, this is about storing every action into a collection of actions. Then everything the user does, throw it on the list/collection of actions, then do the action of the last item on the list.
Now you have an ordered list of specific actions the user did, and you can go back and forth or even all the way to the beginning but undoing all actions backwards.

Read more here
Post Reply

Return to “Project Assistance”