-
-
Save gdyrrahitis/c01ff1b4709c0703fb9d0ae3e5ea4ccd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Undo button handler | |
private void undoButton_Click(object sender, EventArgs e) | |
{ | |
// If history list (stack) contains any command | |
if (_commands.Any()) | |
{ | |
// Pop it out and undo it | |
var command = _commands.Pop(); | |
command.Undo(); | |
} | |
// Refresh UI (trivial operation, omitted for brevity) | |
RefreshWindow(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment