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

            this.Data.Insert(index, cloneData);
            if (callback != null)
            {
                callback(cloneData);
            }
        }
Ejemplo n.º 5
0
 public int GetIndex(JData data)
 {
     return(this.Data.IndexOf((TData)data));
 }