/// <summary>
		/// 加入一个编辑命令, 并正向运行.
		/// </summary>
		public void Push(IEditCommand item)
		{
			sequence.RemoveRange(index + 1, sequence.Count - (index + 1));

			item.PlayForward();
			sequence.Add(item);

			index = sequence.Count - 1;
		}
Exemple #2
0
        public void Perform(IEditCommand command)
        {
            command.Apply();

            _editHistory.RemoveRange(_currentEditPointer + 1, _editHistory.Count - _currentEditPointer - 1);

            _currentEditPointer = _editHistory.Count;
            _editHistory.Add(command);

            raiseRefreshed();
        }
        public void PerformCommand(IEditCommand command, bool performBody = true)
        {
            if (performBody)
            {
                command.Apply();
            }

            _editHistory.RemoveRange(_currentEditPointer + 1, _editHistory.Count - _currentEditPointer - 1);

            _currentEditPointer = _editHistory.Count;
            _editHistory.Add(command);
            raiseChanged();
        }