/// <summary> /// Ends an undo group and pushes the group operations onto the <see cref="UndoStack"/>. /// </summary> /// <remarks> /// An undo group is a group of commandos that is combined into a single /// undo operation. /// </remarks> public void EndUndoGroup() { if (undoGroupDepth == 0) { throw new InvalidOperationException("There are no open undo groups"); } undoGroupDepth--; if (undoGroupDepth == 0 && actionCountInUndoGroup > 1) { UndoQueue op = new UndoQueue(undostack, actionCountInUndoGroup); undostack.Push(op); if (OperationPushed != null) { OperationPushed(this, new OperationEventArgs(op)); } } }
/// <summary> /// Ends an undo group and pushes the group operations onto the <see cref="UndoStack"/>. /// </summary> /// <remarks> /// An undo group is a group of commandos that is combined into a single /// undo operation. /// </remarks> public void EndUndoGroup() { if (undoGroupDepth == 0) throw new InvalidOperationException("There are no open undo groups"); undoGroupDepth--; if (undoGroupDepth == 0 && actionCountInUndoGroup > 1) { UndoQueue op = new UndoQueue(undostack, actionCountInUndoGroup); undostack.Push(op); if (OperationPushed != null) { OperationPushed(this, new OperationEventArgs(op)); } } }