Ejemplo n.º 1
0
 public void AddCommand(EditCommandBase editCommandBase)
 {
     if (this.canCapture && editCommandBase != null)
     {
         this.undoBuffer.Add(editCommandBase);
         this.redoBuffer.Clear();
         this.Dirty = true;
     }
 }
Ejemplo n.º 2
0
        public bool DoRedo(IModel dataModel)
        {
            if (this.redoBuffer.Count == 0)
            {
                return(false);
            }
            this.canCapture = false;
            EditCommandBase editCommandBase = this.redoBuffer[this.redoBuffer.Count - 1];
            bool            result          = editCommandBase.DoRedo(dataModel);

            this.redoBuffer.RemoveAt(this.redoBuffer.Count - 1);
            this.undoBuffer.Add(editCommandBase);
            this.canCapture = true;
            this.Dirty      = true;
            return(result);
        }