12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace DrawTools
- {
-
-
-
- class CommandDeleteAll : Command
- {
- List<DrawObject> cloneList;
-
- public CommandDeleteAll(GraphicsList graphicsList)
- {
- cloneList = new List<DrawObject>();
-
-
-
- int n = graphicsList.Count;
- for ( int i = n - 1; i >= 0; i-- )
- {
- cloneList.Add(graphicsList[i].Clone());
- }
- }
- public override void Undo(GraphicsList list)
- {
-
-
- foreach (DrawObject o in cloneList)
- {
- list.Add(o);
- }
- }
- public override void Redo(GraphicsList list)
- {
-
- list.Clear();
- }
- }
- }
|