Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        internal override ActionStack MakeSnapshot(int type)
        {
            ActionStack action = null;

            switch (type)
            {
            case 4:
                //позиция
                action = new ActionStack(this, 4, Size);
                break;
            }
            return(action);
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
        public void RedoPop()
        {
            if (redoStack.Count == 0)
            {
                return;
            }
            ActionStack action = redoStack.Pop();

            try
            {
                UndoPush(MakeSnapshot(action));
                action.ApplyAction();
            }
            catch (ArgumentException)
            {
                redoStack.Push(action);
            }
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
 public void SaveUndoAction(ActionStack action)
 {
     stack.UndoPush(action);
 }
Exemplo n.º 10
0
 public void RedoPush(ActionStack action)
 {
     redoStack.Push(action);
 }
Exemplo n.º 11
0
 public void UndoPush(ActionStack action)
 {
     undoStack.Push(action);
 }