Пример #1
0
        public void Redo(int commandNumder)
        {
            string command = "";
            int    i       = 0;

            for (i = 0; i < commandNumder && redoElements.Count > 0; i++)
            {
                UndoRedoElement element = redoElements[redoElements.Count - 1];
                redoElements.RemoveAt(redoElements.Count - 1);
                if (element.Redo())
                {
                    OnRedoComplete(element.TypeString, element.Args);
                    if (undoElements.Count == stackCount)
                    {
                        undoElements.RemoveAt(0);
                    }
                    undoElements.Add(element);

                    if (element.TypeString == "RotateCW" || element.TypeString == "RotateCCW")
                    {
                        return;
                    }
                }
                else
                {
                    return;
                }
            }
            OnRedoEnd(command, i, 0);
        }