public void AddCommand(EditCommandBase command)
 {
     if (m_canCapture && command != null)
     {
         m_undoBuffer.Add(command);
         m_redoBuffer.Clear();
         Dirty = true;
     }
 }
        public bool DoRedo(IModel data)
        {
            if (m_redoBuffer.Count == 0)
            {
                return(false);
            }
            m_canCapture = false;
            EditCommandBase command = m_redoBuffer[m_redoBuffer.Count - 1];
            bool            result  = command.DoRedo(data);

            m_redoBuffer.RemoveAt(m_redoBuffer.Count - 1);
            m_undoBuffer.Add(command);
            m_canCapture = true;
            Dirty        = true;
            return(result);
        }
示例#3
0
文件: Undo.cs 项目: jjacksons/GLUE
 public void AddCommand(EditCommandBase command)
 {
     if (m_canCapture && command != null)
     {
         m_undoBuffer.Add(command);
         m_redoBuffer.Clear();
         Dirty = true;
     }
 }