Dev2.UndoFramework.ActionManager.Undo C# (CSharp) Method

Undo() public method

public Undo ( ) : void
return void
        public void Undo()
        {
            if (CanUndo)
            {
                //20.09.2012: massimo.guerrera - Changed not to throw an exception

                if (!ActionIsExecuting)
                {
                    CurrentAction = History.CurrentState.PreviousAction;
                    if (CurrentAction != null)
                    {
                        History.MoveBack();
                        CurrentAction = null;
                    }
                }
            }
        }

Usage Example

// ReSharper disable InconsistentNaming
        public void Undo_Expected_Positive()
// ReSharper restore InconsistentNaming
        {
            ActionManager actManager = new ActionManager();
            actManager.RecordAction(_mockAction.Object);
            actManager.Undo();
            Assert.IsTrue(actManager.CanRedo);
        }
All Usage Examples Of Dev2.UndoFramework.ActionManager::Undo