예제 #1
0
        /// <summary>
        /// 记录当前操作
        /// </summary>
        /// <param oldName="oldName">当前操作项</param>
        public void recordOper(SVRedoUndoItem item)
        {
            if (!isRecord)
            {
                return;
            }

            listItem.RemoveRange(index, listItem.Count - index);

            index++;
            listItem.Add(item);
            operChanged();
        }
예제 #2
0
        /// <summary>
        /// 执行恢复操作
        /// </summary>
        public void Redo()
        {
            if (index >= listItem.Count)
            {
                return;
            }

            index++;
            SVRedoUndoItem item = listItem[index - 1];

            item.ReDo();

            UpdateOperator();
            operChanged();
        }
예제 #3
0
        /// <summary>
        /// 执行撤销操作
        /// </summary>
        public void Undo()
        {
            if (index <= 0)
            {
                return;
            }

            SVRedoUndoItem item = listItem[index - 1];

            item.UnDo();
            index--;

            UpdateOperator();
            operChanged();
        }