C# Class GuiLabs.Undo.ActionManager

Action Manager is a central class for the Undo Framework. Your domain model (business objects) will have an ActionManager reference that would take care of executing actions. Here's how it works: 1. You declare a class that implements IAction 2. You create an instance of it and give it all necessary info that it needs to know to apply or rollback a change 3. You call ActionManager.RecordAction(yourAction) Then you can also call ActionManager.Undo() or ActionManager.Redo()
Datei anzeigen Open project: KirillOsenkov/Undo Class Usage Examples

Private Properties

Property Type Description
CheckNotRunningBeforeRecording void
RunActionDirectly void

Public Methods

Method Description
ActionManager ( ) : System
Clear ( ) : void
CommitTransaction ( ) : void
CreateTransaction ( ) : Transaction
CreateTransaction ( bool delayed ) : Transaction
EnumRedoableActions ( ) : IEnumerable
EnumUndoableActions ( ) : IEnumerable
OpenTransaction ( Transaction t ) : void
RecordAction ( IAction action ) : void

Central method to add and execute a new action.

Redo ( ) : void
RollBackTransaction ( ) : void
Undo ( ) : void

Protected Methods

Method Description
RaiseUndoBufferChanged ( object sender, EventArgs e ) : void

Private Methods

Method Description
CheckNotRunningBeforeRecording ( IAction candidate ) : void
RunActionDirectly ( IAction actionToRun ) : void

Adds the action to the buffer and runs it

Method Details

ActionManager() public method

public ActionManager ( ) : System
return System

Clear() public method

public Clear ( ) : void
return void

CommitTransaction() public method

public CommitTransaction ( ) : void
return void

CreateTransaction() public method

public CreateTransaction ( ) : Transaction
return Transaction

CreateTransaction() public method

public CreateTransaction ( bool delayed ) : Transaction
delayed bool
return Transaction

EnumRedoableActions() public method

public EnumRedoableActions ( ) : IEnumerable
return IEnumerable

EnumUndoableActions() public method

public EnumUndoableActions ( ) : IEnumerable
return IEnumerable

OpenTransaction() public method

public OpenTransaction ( Transaction t ) : void
t Transaction
return void

RaiseUndoBufferChanged() protected method

protected RaiseUndoBufferChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

RecordAction() public method

Central method to add and execute a new action.
public RecordAction ( IAction action ) : void
action IAction
return void

Redo() public method

public Redo ( ) : void
return void

RollBackTransaction() public method

public RollBackTransaction ( ) : void
return void

Undo() public method

public Undo ( ) : void
return void