Exemple #1
0
        public UndoManager(Layers layerList)
        {
            layers = layerList;

            ClearHistory();
        }
 public override void Redo(Layers list)
 {
     // Clear list - make DeleteAll again
     list[list.ActiveLayerIndex].Graphics.Clear();
 }
 public override void Redo(Layers list)
 {
     // Replace all objects in the list with objects from listAfter
     ReplaceObjects(list[activeLayer].Graphics, listAfter);
 }
 public override void Undo(Layers list)
 {
     // Replace all objects in the list with objects from listBefore
     ReplaceObjects(list[activeLayer].Graphics, listBefore);
 }
 // Call this function AFTER operation.
 public void NewState(Layers layerList)
 {
     // Keep objects state after operation.
     FillList(layerList[activeLayer].Graphics, ref listAfter);
 }
 // Create this command BEFORE operation.
 public CommandChangeState(Layers layerList)
 {
     // Keep objects state before operation.
     activeLayer = layerList.ActiveLayerIndex;
     FillList(layerList[activeLayer].Graphics, ref listBefore);
 }
 /// <summary>
 /// Undo last Add command
 /// </summary>
 /// <param name="list">Layers collection</param>
 public override void Undo(Layers list)
 {
     list[list.ActiveLayerIndex].Graphics.DeleteLastAddedObject();
 }