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 JDataCommand(int commandID, JDataCommandType type, JData beforeData, JData afterData, int index) { CommandID = commandID; Type = type; BeforeData = beforeData; AfterData = afterData; ChangedIndex = index; }
public void ChangeData(int index, JData data) { if (index < 0) { return; } this.Data.RemoveAt(index); this.Data.Insert(index, (TData)data.Clone()); }
public void AddData(int index, JData data, AddNewDataCallback callback) { TData cloneData = (TData)data.Clone(); this.Data.Insert(index, cloneData); if (callback != null) { callback(cloneData); } }
public int GetIndex(JData data) { return(this.Data.IndexOf((TData)data)); }