public void Add(JDataCommandType type, JData beforeData, JData afterData, int index) { JDataCommand command = new JDataCommand(m_newCommandID++, type, beforeData, afterData, index); m_currendCommandID = command.CommandID; m_undoStack.Push(command); m_redoStack.Clear(); }
public void Redo() { JDataCommand command = m_redoStack.Pop(); m_currendCommandID = command.CommandID; switch (command.Type) { case JDataCommandType.Property_Add: AddCallback(command.ChangedIndex, command.AfterData); break; case JDataCommandType.Property_Changed: ChangeCallback(command.ChangedIndex, command.AfterData); break; case JDataCommandType.Property_Remove: RemoveCallback(command.ChangedIndex, command.BeforeData); break; default: break; } m_undoStack.Push(command); }