C# Класс 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()
Наследование: IActionManager
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
CheckNotRunningBeforeRecording void
RunActionDirectly void

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
RaiseUndoBufferChanged ( object sender, EventArgs e ) : void

Raises the undo buffer changed.

Приватные методы

Метод Описание
CheckNotRunningBeforeRecording ( IAction existingAction ) : void

Checks the not running before recording.

RunActionDirectly ( IAction actionToRun ) : void

Adds the action to the buffer and runs it

Описание методов

ActionManager() публичный Метод

Initializes a new instance of the ActionManager class.
public ActionManager ( ) : System
Результат System

BeginTransaction() публичный Метод

Begins the transaction.
public BeginTransaction ( ) : void
Результат void

CancelTransaction() публичный Метод

Cancels the transaction.
public CancelTransaction ( ) : void
Результат void

Clear() публичный Метод

Clears this instance.
public Clear ( ) : void
Результат void

CommitTransaction() публичный Метод

Commits the transaction.
public CommitTransaction ( ) : void
Результат void

CreateTransaction() публичный Метод

Creates the transaction.
public CreateTransaction ( ) : Transaction
Результат Transaction

CreateTransaction() публичный Метод

Creates the transaction.
public CreateTransaction ( bool delayed ) : Transaction
delayed bool if set to true [delayed].
Результат Transaction

EnumUndoableActions() публичный Метод

Enums the undoable actions.
public EnumUndoableActions ( ) : IEnumerable
Результат IEnumerable

Execute() публичный Метод

Executes the specified action.
public Execute ( IAction action ) : void
action IAction The action.
Результат void

IsInTransaction() публичный Метод

Determines whether is in transaction.
public IsInTransaction ( ) : bool
Результат bool

OpenTransaction() публичный Метод

Opens the transaction.
public OpenTransaction ( ITransaction t ) : void
t ITransaction The t.
Результат void

RaiseUndoBufferChanged() защищенный Метод

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.
Результат void

RecordAction() публичный Метод

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
Результат void

RecordOrExcuteAction() публичный Метод

Records the or excute action.
public RecordOrExcuteAction ( IAction existingAction ) : void
existingAction IAction The existing action.
Результат void

Recover() публичный Метод

Recovers this instance from exception.
public Recover ( ) : void
Результат void

Redo() публичный Метод

Redoes this instance.
public Redo ( ) : void
Результат void

RollBackTransaction() публичный Метод

Rolls the back transaction.
public RollBackTransaction ( ) : void
Результат void

Undo() публичный Метод

Undoes this instance.
public Undo ( ) : void
Результат void