protected override void DiscardUndoUnit(UndoEngine.UndoUnit unit)
 {
     this.undoUnitList.Remove(unit);
     this.currentPos--;
     base.DiscardUndoUnit(unit);
     this.UpdateUndoRedoMenuCommandsStatus();
 }
Esempio n. 2
0
 protected override void AddUndoUnit(UndoEngine.UndoUnit unit)
 {
     undoUnitList.RemoveRange(currentPos, undoUnitList.Count - currentPos);
     undoUnitList.Add(unit);
     currentPos = undoUnitList.Count;
     UpdateUndoRedoMenuCommandsStatus();
 }
Esempio n. 3
0
 protected override void DiscardUndoUnit(UndoEngine.UndoUnit unit)
 {
     base.DiscardUndoUnit(unit);
     if (_undoUnits.Count > 0 && Object.ReferenceEquals(unit, _undoUnits.Peek()))
     {
         _undoUnits.Pop();
     }
 }
Esempio n. 4
0
 protected override void AddUndoUnit(UndoEngine.UndoUnit unit)
 {
     if (Enabled)
     {
         _undoStack.Push(unit);
         _redoStack.Clear();
     }
 }
 public void Undo()
 {
     if (this.undoStack.Count > 0)
     {
         UndoEngine.UndoUnit item = this.undoStack.Pop();
         item.Undo();
         this.redoStack.Push(item);
     }
 }
Esempio n. 6
0
 public void Redo()
 {
     if (redoStack.Count > 0)
     {
         UndoEngine.UndoUnit unit = redoStack.Pop();
         unit.Undo();
         undoStack.Push(unit);
     }
 }
Esempio n. 7
0
 public void Undo()
 {
     if (undoStack.Count > 0)
     {
         UndoEngine.UndoUnit unit = undoStack.Pop();
         undoUnitName = unit.Name;
         unit.Undo();
         redoStack.Push(unit);
     }
 }
Esempio n. 8
0
 public void DoUndo()
 {
     if (currentPos > 0)
     {
         UndoEngine.UndoUnit undoUnit = undoUnitList[currentPos - 1];
         undoUnit.Undo();
         currentPos--;
     }
     UpdateUndoRedoMenuCommandsStatus();
 }
Esempio n. 9
0
 public void DoRedo()
 {
     if (currentPos < undoUnitList.Count)
     {
         UndoEngine.UndoUnit undoUnit = undoUnitList[currentPos];
         undoUnit.Undo();
         currentPos++;
     }
     UpdateUndoRedoMenuCommandsStatus();
 }
 public void DoRedo()
 {
     if (this.currentPos < this.undoUnitList.Count)
     {
         UndoEngine.UndoUnit undoUnit = this.undoUnitList[this.currentPos];
         undoUnit.Undo();
         this.currentPos++;
     }
     this.UpdateUndoRedoMenuCommandsStatus();
 }
 public void DoUndo()
 {
     if (this.currentPos > 0)
     {
         UndoEngine.UndoUnit undoUnit = this.undoUnitList[this.currentPos - 1];
         undoUnit.Undo();
         this.currentPos--;
     }
     this.UpdateUndoRedoMenuCommandsStatus();
 }
 protected override void AddUndoUnit(UndoEngine.UndoUnit unit)
 {
     this.undoUnitList.RemoveRange(this.currentPos, this.undoUnitList.Count - this.currentPos);
     if (this.undoUnitList.Count > 100)
     {
         this.undoUnitList.RemoveAt(0);
     }
     this.undoUnitList.Add(unit);
     this.currentPos = this.undoUnitList.Count;
     this.UpdateUndoRedoMenuCommandsStatus();
 }
Esempio n. 13
0
        /// <summary>
        /// 放弃 UndoEngine.UndoUnit。
        /// </summary>
        /// <param name="unit"></param>
        protected override void DiscardUndoUnit(UndoEngine.UndoUnit unit)
        {
            //undoUnitList.Remove(unit);
            base.DiscardUndoUnit(unit);


            if (cassPropertyGrid != null)
            {
                cassPropertyGrid.Refresh();
            }
            //this.Enabled = false;
        }
Esempio n. 14
0
        /// <summary>
        /// 将 UndoEngine.UndoUnit 添加到撤消堆栈中。
        /// </summary>
        /// <param name="unit"></param>
        protected override void AddUndoUnit(UndoEngine.UndoUnit unit)
        {
            tempUnList.Add(unit);

            if (editToolStripMenuItem.DropDownItems.Count > 0)
            {
                editToolStripMenuItem.DropDownItems[undoIndex].Enabled = true;
            }


            if (cassPropertyGrid != null)
            {
                cassPropertyGrid.Refresh();
            }
            //this.Enabled = false;
        }
Esempio n. 15
0
 public void Redo()
 {
     if (redoStack.Count > 0)
     {
         try {
             UndoEngine.UndoUnit unit = redoStack.Pop();
             unit.Undo();
             undoStack.Push(unit);
             //Log("::Redo - redo action performed: " + unit.Name);
         }
         catch  {
             //Log("::Redo() - Exception " + ex.Message + " (line:" + new StackFrame(true).GetFileLineNumber() + ")");
         }
     }
     else
     {
         //Log("::Redo - NO redo action to perform!");
     }
 }
Esempio n. 16
0
 public void Undo()
 {
     if (undoStack.Count > 0)
     {
         try {
             UndoEngine.UndoUnit unit = undoStack.Pop();
             unit.Undo();
             redoStack.Push(unit);
             //Log("::Undo - undo action performed: " + unit.Name);
         }
         catch (Exception ex) {
             Debug.WriteLine(_Name_ + ex.Message);
             //Log("::Undo() - Exception " + ex.Message + " (line:" + new StackFrame(true).GetFileLineNumber() + ")");
         }
     }
     else
     {
         //Log("::Undo - NO undo action to perform!");
     }
 }
Esempio n. 17
0
 public void Redo( )
 {
     if (redoStack.Count > 0)
     {
         try
         {
             UndoEngine.UndoUnit unit = redoStack.Pop();
             unit.Undo();
             undoStack.Push(unit);
             //Update the CanUndo and CanRedo state
             CanUndo = undoStack.Count == 0?false:true;
             CanRedo = redoStack.Count == 0?false:true;
             //Log("::Redo - redo action performed: " + unit.Name);
         }
         catch (Exception ex)
         {
             //Log("::Redo() - Exception " + ex.Message + " (line:" + new StackFrame(true).GetFileLineNumber() + ")");
         }
     }
     else
     {
         //Log("::Redo - NO redo action to perform!");
     }
 }
Esempio n. 18
0
 protected override void AddUndoUnit(UndoEngine.UndoUnit unit)
 {
     undoStack.Push(unit);
 }
Esempio n. 19
0
 protected override void DiscardUndoUnit(UndoEngine.UndoUnit unit)
 {
     undoUnitList.Remove(unit);
     base.DiscardUndoUnit(unit);
 }
Esempio n. 20
0
 protected override void AddUndoUnit(UndoEngine.UndoUnit unit)
 {
     undoUnitList.RemoveRange(currentPos, undoUnitList.Count - currentPos);
     undoUnitList.Add(unit);
     currentPos = undoUnitList.Count;
 }
Esempio n. 21
0
 protected override void AddUndoUnit(UndoEngine.UndoUnit unit)
 {
     _undoUnits.Push(unit);
     _redoUnits.Clear();
 }