internal ActionStack MakeSnapshot(int type) { ActionStack action = null; switch (type) { case 2: action = new ActionStack(this, 2, label.Top); break; case 3: action = new ActionStack(this, 3, panelDesktop.BackColor); break; case 4: action = new ActionStack(this, 4, globalScale); break; case 5: action = new ActionStack(this, 5, innerHeader.Visible); break; case 6: action = new ActionStack(this, 6, _inventoryDrawed); break; } return(action); }
internal override ActionStack MakeSnapshot(int type) { /* * 4 - overlayEnabled * 5 - overlayScale * 6 - overlayLocation * */ if (type < 4) { return(base.MakeSnapshot(type)); } ActionStack action = null; switch (type) { case 4: action = new ActionStack(this, 4, overlayEnabled); break; case 5: action = new ActionStack(this, 5, overlayScale); break; case 6: action = new ActionStack(this, 6, pictureBox2.Location); break; } return(action); }
internal override ActionStack MakeSnapshot(int type) { ActionStack action = null; switch (type) { case 4: //позиция action = new ActionStack(this, 4, Size); break; } return(action); }
private ActionStack MakeSnapshot(ActionStack action) { Type type = action.c.GetType(); if (type == typeof(CloseButton) || type == typeof(InnerBitmap) || type == typeof(InnerButton) || type == typeof(InnerImage) || type == typeof(InvSlot) || type == typeof(Scale) || type == typeof(Slot) || type == typeof(InnerText) || type == typeof(InnerControl)) { return(((InnerControl)action.c).MakeSnapshot(action.type)); } else if (action.c.GetType() == typeof(InnerTabPage)) { return(((InnerTabPage)action.c).MakeSnapshot(action.type)); } throw new ArgumentException(); }
public void RedoPop() { if (redoStack.Count == 0) { return; } ActionStack action = redoStack.Pop(); try { UndoPush(MakeSnapshot(action)); action.ApplyAction(); } catch (ArgumentException) { redoStack.Push(action); } }
internal override ActionStack MakeSnapshot(int type) { /* * 4 - global * */ if (type < 4) { return(base.MakeSnapshot(type)); } ActionStack action = null; switch (type) { case 4: //позиция action = new ActionStack(this, 4, global); break; } return(action); }
internal virtual ActionStack MakeSnapshot(int type) { ActionStack action = null; switch (type) { case 1: //позиция action = new ActionStack(this, 1, Location); break; case 2: //размер action = new ActionStack(this, 2, scale); break; case 3: //видимость action = new ActionStack(this, 2, Visible); break; } return(action); }
internal override ActionStack MakeSnapshot(int type) { /* * 4 - visual * 5 - transparent */ if (type < 4) { return(base.MakeSnapshot(type)); } ActionStack action = null; switch (type) { case 4: action = new ActionStack(this, 4, Visual); break; case 5: action = new ActionStack(this, 5, TransparentBg); break; } return(action); }
public void SaveUndoAction(ActionStack action) { stack.UndoPush(action); }
public void RedoPush(ActionStack action) { redoStack.Push(action); }
public void UndoPush(ActionStack action) { undoStack.Push(action); }