Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Undo()
- {
- if (currentIndex.Operation == remove) { // Als laatste operatie een 'remove' was, voeg de value opnieuw toe.
- .Add(current.Value);
- }
- if (currentIndex.Operation == add) { // Als laatste operatie een 'add' was, verwijder de value.
- .Remove(current.Value);
- }
- if (currentIndex.Previous == null) // Als de previous index null is (aka je zit op de 'First' node), zet de index ook op null.
- {
- currentIndex = null;
- }
- else // Zo niet, zet hem gewoon op de vorige :)
- {
- currentIndex = currentIndex.Previous;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement