C# Class Illusion.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()
Inheritance: IActionManager
Mostra file Open project: kasicass/kasicass

Private Properties

Property Type Description
CheckNotRunningBeforeRecording void
RunActionDirectly void

Public Methods

Method Description
ActionManager ( ) : System

Initializes a new instance of the ActionManager class.

BeginTransaction ( ) : void

Begins the transaction.

CancelTransaction ( ) : void

Cancels the transaction.

Clear ( ) : void

Clears this instance.

CommitTransaction ( ) : void

Commits the transaction.

CreateTransaction ( ) : Transaction

Creates the transaction.

CreateTransaction ( bool delayed ) : Transaction

Creates the transaction.

EnumUndoableActions ( ) : IEnumerable

Enums the undoable actions.

Execute ( IAction action ) : void

Executes the specified action.

IsInTransaction ( ) : bool

Determines whether is in transaction.

OpenTransaction ( ITransaction t ) : void

Opens the transaction.

RecordAction ( IAction existingAction ) : void

Central method to add and execute a new action.

RecordOrExcuteAction ( IAction existingAction ) : void

Records the or excute action.

Recover ( ) : void

Recovers this instance from exception.

Redo ( ) : void

Redoes this instance.

RollBackTransaction ( ) : void

Rolls the back transaction.

Undo ( ) : void

Undoes this instance.

Protected Methods

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

Raises the undo buffer changed.

Private Methods

Method Description
CheckNotRunningBeforeRecording ( IAction existingAction ) : void

Checks the not running before recording.

RunActionDirectly ( IAction actionToRun ) : void

Adds the action to the buffer and runs it

Method Details

ActionManager() public method

Initializes a new instance of the ActionManager class.
public ActionManager ( ) : System
return System

BeginTransaction() public method

Begins the transaction.
public BeginTransaction ( ) : void
return void

CancelTransaction() public method

Cancels the transaction.
public CancelTransaction ( ) : void
return void

Clear() public method

Clears this instance.
public Clear ( ) : void
return void

CommitTransaction() public method

Commits the transaction.
public CommitTransaction ( ) : void
return void

CreateTransaction() public method

Creates the transaction.
public CreateTransaction ( ) : Transaction
return Transaction

CreateTransaction() public method

Creates the transaction.
public CreateTransaction ( bool delayed ) : Transaction
delayed bool if set to true [delayed].
return Transaction

EnumUndoableActions() public method

Enums the undoable actions.
public EnumUndoableActions ( ) : IEnumerable
return IEnumerable

Execute() public method

Executes the specified action.
public Execute ( IAction action ) : void
action IAction The action.
return void

IsInTransaction() public method

Determines whether is in transaction.
public IsInTransaction ( ) : bool
return bool

OpenTransaction() public method

Opens the transaction.
public OpenTransaction ( ITransaction t ) : void
t ITransaction The t.
return void

RaiseUndoBufferChanged() protected method

Raises the undo buffer changed.
protected RaiseUndoBufferChanged ( object sender, EventArgs e ) : void
sender object The sender.
e System.EventArgs The instance containing the event data.
return void

RecordAction() public method

Central method to add and execute a new action.
public RecordAction ( IAction existingAction ) : void
existingAction IAction An action to be recorded in the buffer and executed
return void

RecordOrExcuteAction() public method

Records the or excute action.
public RecordOrExcuteAction ( IAction existingAction ) : void
existingAction IAction The existing action.
return void

Recover() public method

Recovers this instance from exception.
public Recover ( ) : void
return void

Redo() public method

Redoes this instance.
public Redo ( ) : void
return void

RollBackTransaction() public method

Rolls the back transaction.
public RollBackTransaction ( ) : void
return void

Undo() public method

Undoes this instance.
public Undo ( ) : void
return void