12345678910111213141516171819202122232425 |
- namespace PaintDotNet.Annotation.Command
- {
- class CommandAdd : Command
- {
- DrawObject drawObject;
- // Create this command with DrawObject instance added to the list
- public CommandAdd(DrawObject drawObject) : base()
- {
- // Keep copy of added object
- this.drawObject = drawObject.Clone();
- }
- public override void Undo(GraphicsList list)
- {
- list.DeleteLastAddedObject();
- }
- public override void Redo(GraphicsList list)
- {
- list.UnselectAll();
- list.Add(drawObject);
- }
- }
- }
|