Skip to content

Instantly share code, notes, and snippets.

@gdyrrahitis

gdyrrahitis/MainForm.cs Secret

Created Nov 10, 2018
Embed
What would you like to do?
// 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
You can’t perform that action at this time.