Advertisement
Guest User

Untitled

a guest
Oct 8th, 2015
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1.         public void Undo()
  2.         {
  3.             if (currentIndex.Operation == remove) { // Als laatste operatie een 'remove' was, voeg de value opnieuw toe.
  4.                 .Add(current.Value);
  5.         }
  6.  
  7.             if (currentIndex.Operation == add) { // Als laatste operatie een 'add' was, verwijder de value.
  8.                 .Remove(current.Value);
  9.         }
  10.  
  11.             if (currentIndex.Previous == null) // Als de previous index null is (aka je zit op de 'First' node), zet de index ook op null.
  12.             {
  13.                 currentIndex = null;
  14.             }
  15.             else // Zo niet, zet hem gewoon op de vorige :)
  16.             {
  17.                 currentIndex = currentIndex.Previous;
  18.             }
  19.            
  20.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement