Skip to content

Instantly share code, notes, and snippets.


gdyrrahitis/MainForm.cs Secret

Created Nov 10, 2018
What would you like to do?
public partial class MainForm : Form
// Code omitted for brevity
// The history list
private Stack<ICommand> _commands = new Stack<ICommand>();
// Code omitted for brevity
// Draws the shape on canvas
private void canvas_MouseDown(object sender, MouseEventArgs e)
// We get the command based on the shape selection
// and we draw it in the X, Y coordinates
var command = GetCommand(e.X, e.Y);
// We store the command in the history list
// Refresh the UI (trivial code, omitted for brevity)
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.