![]() |
Paradox Game Engine
v1.0.0 beta06
|
This class represents a thread-safe stack of action items that can be undone/redone. More...
Public Member Functions | |||
ActionStack (int capacity) | |||
Initializes a new instance of the ActionStack class with the given capacity. More... | |||
ActionStack (int capacity, IEnumerable< IActionItem > initialActionsItems) | |||
Initializes a new instance of the ActionStack class with the given capacity and existing action items. More... | |||
virtual void | Add (IActionItem item) | ||
Adds an action item to the stack. Discards any action item that is currently undone.
| |||
void | AddRange (IEnumerable< IActionItem > items) | ||
Adds multiple action items on the stack. Discards any action item that is currently undone.
| |||
void | Clear () | ||
Clears the action stack. More... | |||
virtual SavePoint | CreateSavePoint (bool markActionsAsSaved) | ||
Creates a save point at the current index of the action stack.
| |||
virtual bool | Undo () | ||
Undoes the last action item that is currently done.
| |||
virtual bool | Redo () | ||
Redoes the first action item that is currently undone.
| |||
Protected Member Functions | |
virtual void | OnActionItemsDiscarded (DiscardedActionItemsEventArgs< IActionItem > e) |
Invoked whenever action items are discarded from the stack. More... | |
virtual void | OnActionItemsAdded (ActionItemsEventArgs< IActionItem > e) |
Invoked whenever action items are added to the stack. More... | |
virtual void | OnActionItemsCleared () |
Invoked whenever the action stack is cleared. More... | |
virtual void | OnUndone (ActionItemsEventArgs< IActionItem > e) |
Invoked Raised when an action item is undone. More... | |
virtual void | OnRedone (ActionItemsEventArgs< IActionItem > e) |
Invoked Raised when an action item is redone. More... | |
Properties | |
IEnumerable< IActionItem > | ActionItems [get] |
int | Capacity [get] |
Gets the capacity of this action stack. More... | |
bool | CanUndo [get] |
Gets whether an undo operation can be executed. More... | |
bool | CanRedo [get] |
Gets whether an redo operation can be executed. More... | |
int | CurrentIndex [get, set] |
Gets the index at which the next action item will be added. More... | |
bool | UndoRedoInProgress [get, set] |
Gets whether an undo/redo operation is currently in progress. More... | |
![]() | |
IEnumerable< IActionItem > | ActionItems [get] |
Gets the action items currently stored in the action stack, including undone items that have not been disbranched. More... | |
Events | |
EventHandler < ActionItemsEventArgs < IActionItem > > | ActionItemsAdded |
Raised whenever action items are added to the stack. More... | |
EventHandler | ActionItemsCleared |
Raised whenever the action stack is cleared. More... | |
EventHandler < DiscardedActionItemsEventArgs < IActionItem > > | ActionItemsDiscarded |
Raised whenever action items are discarded from the stack. More... | |
EventHandler < ActionItemsEventArgs < IActionItem > > | Undone |
Raised when an action item is undone. More... | |
EventHandler < ActionItemsEventArgs < IActionItem > > | Redone |
Raised when an action item is redone. More... | |
![]() | |
EventHandler < ActionItemsEventArgs < IActionItem > > | ActionItemsAdded |
Raised whenever action items are added to the stack. More... | |
EventHandler | ActionItemsCleared |
Raised whenever the action stack is cleared. More... | |
EventHandler < DiscardedActionItemsEventArgs < IActionItem > > | ActionItemsDiscarded |
Raised whenever action items are discarded from the stack. More... | |
EventHandler < ActionItemsEventArgs < IActionItem > > | Undone |
Raised when an action item is undone. More... | |
EventHandler < ActionItemsEventArgs < IActionItem > > | Redone |
Raised when an action item is redone. More... | |
This class represents a thread-safe stack of action items that can be undone/redone.
Definition at line 12 of file ActionStack.cs.
SiliconStudio.ActionStack.ActionStack.ActionStack | ( | int | capacity | ) |
Initializes a new instance of the ActionStack class with the given capacity.
capacity | The stack capacity. If negative, the action stack will have an unlimited capacity. |
Definition at line 22 of file ActionStack.cs.
SiliconStudio.ActionStack.ActionStack.ActionStack | ( | int | capacity, |
IEnumerable< IActionItem > | initialActionsItems | ||
) |
Initializes a new instance of the ActionStack class with the given capacity and existing action items.
capacity | The stack capacity. If negative, the action stack will have an unlimited capacity. |
initialActionsItems | The action items to add to the stack. |
Definition at line 32 of file ActionStack.cs.
|
virtual |
Adds an action item to the stack. Discards any action item that is currently undone.
item | The action item to add to the stack. |
Implements SiliconStudio.ActionStack.IActionStack.
Reimplemented in SiliconStudio.ActionStack.TransactionalActionStack, and SiliconStudio.Presentation.ViewModel.ActionStack.ViewModelTransactionalActionStack.
Definition at line 99 of file ActionStack.cs.
References SiliconStudio.ActionStack.UndoRedoInProgress.
void SiliconStudio.ActionStack.ActionStack.AddRange | ( | IEnumerable< IActionItem > | items | ) |
Adds multiple action items on the stack. Discards any action item that is currently undone.
items | The action items to add on the stack. |
Implements SiliconStudio.ActionStack.IActionStack.
Definition at line 115 of file ActionStack.cs.
void SiliconStudio.ActionStack.ActionStack.Clear | ( | ) |
Clears the action stack.
Implements SiliconStudio.ActionStack.IActionStack.
Definition at line 128 of file ActionStack.cs.
|
virtual |
Creates a save point at the current index of the action stack.
markActionsAsSaved | Indicate whether to set the IActionItem.IsSaved of all preceding action items to true. |
Implements SiliconStudio.ActionStack.IActionStack.
Reimplemented in SiliconStudio.Presentation.ViewModel.ActionStack.ViewModelTransactionalActionStack.
Definition at line 135 of file ActionStack.cs.
References SiliconStudio.ActionStack.SavePoint.Empty.
|
protectedvirtual |
Invoked whenever action items are added to the stack.
e | The arguments that will be passed to the ActionItemsAdded event raised by this method. |
Reimplemented in SiliconStudio.Presentation.ViewModel.ActionStack.ViewModelTransactionalActionStack.
Definition at line 213 of file ActionStack.cs.
|
protectedvirtual |
Invoked whenever the action stack is cleared.
Definition at line 223 of file ActionStack.cs.
|
protectedvirtual |
Invoked whenever action items are discarded from the stack.
e | The arguments that will be passed to the ActionItemsDiscarded event raised by this method. |
Reimplemented in SiliconStudio.Presentation.ViewModel.ActionStack.ViewModelTransactionalActionStack.
Definition at line 202 of file ActionStack.cs.
|
protectedvirtual |
Invoked Raised when an action item is redone.
e | The arguments that will be passed to the Redone event raised by this method. |
Definition at line 245 of file ActionStack.cs.
|
protectedvirtual |
Invoked Raised when an action item is undone.
e | The arguments that will be passed to the Undone event raised by this method. |
Definition at line 234 of file ActionStack.cs.
|
virtual |
Redoes the first action item that is currently undone.
True
if an action could be redone, False
otherwise.Implements SiliconStudio.ActionStack.IActionStack.
Definition at line 175 of file ActionStack.cs.
References SiliconStudio.ActionStack.UndoRedoInProgress.
|
virtual |
Undoes the last action item that is currently done.
True
if an action could be undone, False
otherwise.Implements SiliconStudio.ActionStack.IActionStack.
Definition at line 150 of file ActionStack.cs.
References SiliconStudio.ActionStack.UndoRedoInProgress.
|
get |
Definition at line 46 of file ActionStack.cs.
|
get |
Gets whether an redo operation can be executed.
Definition at line 61 of file ActionStack.cs.
|
get |
Gets whether an undo operation can be executed.
Definition at line 56 of file ActionStack.cs.
|
get |
Gets the capacity of this action stack.
Definition at line 51 of file ActionStack.cs.
|
getsetprotected |
Gets the index at which the next action item will be added.
Definition at line 91 of file ActionStack.cs.
|
getsetprotected |
Gets whether an undo/redo operation is currently in progress.
Definition at line 96 of file ActionStack.cs.
EventHandler<ActionItemsEventArgs<IActionItem> > SiliconStudio.ActionStack.ActionStack.ActionItemsAdded |
Raised whenever action items are added to the stack.
Definition at line 66 of file ActionStack.cs.
EventHandler SiliconStudio.ActionStack.ActionStack.ActionItemsCleared |
Raised whenever the action stack is cleared.
Definition at line 71 of file ActionStack.cs.
EventHandler<DiscardedActionItemsEventArgs<IActionItem> > SiliconStudio.ActionStack.ActionStack.ActionItemsDiscarded |
Raised whenever action items are discarded from the stack.
Definition at line 76 of file ActionStack.cs.
EventHandler<ActionItemsEventArgs<IActionItem> > SiliconStudio.ActionStack.ActionStack.Redone |
Raised when an action item is redone.
Definition at line 86 of file ActionStack.cs.
EventHandler<ActionItemsEventArgs<IActionItem> > SiliconStudio.ActionStack.ActionStack.Undone |
Raised when an action item is undone.
Definition at line 81 of file ActionStack.cs.