Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SiliconStudio.ActionStack.ActionStack Class Reference

This class represents a thread-safe stack of action items that can be undone/redone. More...

Inheritance diagram for SiliconStudio.ActionStack.ActionStack:
SiliconStudio.ActionStack.IActionStack SiliconStudio.ActionStack.TransactionalActionStack SiliconStudio.Presentation.ViewModel.ActionStack.ViewModelTransactionalActionStack

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.
Parameters
itemThe action item to add to the stack.
More...
 
void AddRange (IEnumerable< IActionItem > items)
 Adds multiple action items on the stack. Discards any action item that is currently undone.
Parameters
itemsThe action items to add on the stack.
More...
 
void Clear ()
 Clears the action stack. More...
 
virtual SavePoint CreateSavePoint (bool markActionsAsSaved)
 Creates a save point at the current index of the action stack.
Parameters
markActionsAsSavedIndicate whether to set the IActionItem.IsSaved of all preceding action items to true.
Returns
A SavePoint object corresponding to the created save point.
More...
 
virtual bool Undo ()
 Undoes the last action item that is currently done.
Returns
True if an action could be undone, False otherwise.
More...
 
virtual bool Redo ()
 Redoes the first action item that is currently undone.
Returns
True if an action could be redone, False otherwise.
More...
 

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< IActionItemActionItems [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...
 
- Properties inherited from SiliconStudio.ActionStack.IActionStack
IEnumerable< IActionItemActionItems [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...
 
- Events inherited from SiliconStudio.ActionStack.IActionStack
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...
 

Detailed Description

This class represents a thread-safe stack of action items that can be undone/redone.

Definition at line 12 of file ActionStack.cs.

Constructor & Destructor Documentation

SiliconStudio.ActionStack.ActionStack.ActionStack ( int  capacity)

Initializes a new instance of the ActionStack class with the given capacity.

Parameters
capacityThe 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.

Parameters
capacityThe stack capacity. If negative, the action stack will have an unlimited capacity.
initialActionsItemsThe action items to add to the stack.

Definition at line 32 of file ActionStack.cs.

Member Function Documentation

virtual void SiliconStudio.ActionStack.ActionStack.Add ( IActionItem  item)
virtual

Adds an action item to the stack. Discards any action item that is currently undone.

Parameters
itemThe 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.

Parameters
itemsThe 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 SavePoint SiliconStudio.ActionStack.ActionStack.CreateSavePoint ( bool  markActionsAsSaved)
virtual

Creates a save point at the current index of the action stack.

Parameters
markActionsAsSavedIndicate whether to set the IActionItem.IsSaved of all preceding action items to true.
Returns
A SavePoint object corresponding to the created save point.

Implements SiliconStudio.ActionStack.IActionStack.

Reimplemented in SiliconStudio.Presentation.ViewModel.ActionStack.ViewModelTransactionalActionStack.

Definition at line 135 of file ActionStack.cs.

References SiliconStudio.ActionStack.SavePoint.Empty.

virtual void SiliconStudio.ActionStack.ActionStack.OnActionItemsAdded ( ActionItemsEventArgs< IActionItem e)
protectedvirtual

Invoked whenever action items are added to the stack.

Parameters
eThe 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.

virtual void SiliconStudio.ActionStack.ActionStack.OnActionItemsCleared ( )
protectedvirtual

Invoked whenever the action stack is cleared.

Definition at line 223 of file ActionStack.cs.

virtual void SiliconStudio.ActionStack.ActionStack.OnActionItemsDiscarded ( DiscardedActionItemsEventArgs< IActionItem e)
protectedvirtual

Invoked whenever action items are discarded from the stack.

Parameters
eThe 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.

virtual void SiliconStudio.ActionStack.ActionStack.OnRedone ( ActionItemsEventArgs< IActionItem e)
protectedvirtual

Invoked Raised when an action item is redone.

Parameters
eThe arguments that will be passed to the Redone event raised by this method.

Definition at line 245 of file ActionStack.cs.

virtual void SiliconStudio.ActionStack.ActionStack.OnUndone ( ActionItemsEventArgs< IActionItem e)
protectedvirtual

Invoked Raised when an action item is undone.

Parameters
eThe arguments that will be passed to the Undone event raised by this method.

Definition at line 234 of file ActionStack.cs.

virtual bool SiliconStudio.ActionStack.ActionStack.Redo ( )
virtual

Redoes the first action item that is currently undone.

Returns
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 bool SiliconStudio.ActionStack.ActionStack.Undo ( )
virtual

Undoes the last action item that is currently done.

Returns
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.

Property Documentation

IEnumerable<IActionItem> SiliconStudio.ActionStack.ActionStack.ActionItems
get

Definition at line 46 of file ActionStack.cs.

bool SiliconStudio.ActionStack.ActionStack.CanRedo
get

Gets whether an redo operation can be executed.

Definition at line 61 of file ActionStack.cs.

bool SiliconStudio.ActionStack.ActionStack.CanUndo
get

Gets whether an undo operation can be executed.

Definition at line 56 of file ActionStack.cs.

int SiliconStudio.ActionStack.ActionStack.Capacity
get

Gets the capacity of this action stack.

Definition at line 51 of file ActionStack.cs.

int SiliconStudio.ActionStack.ActionStack.CurrentIndex
getsetprotected

Gets the index at which the next action item will be added.

Definition at line 91 of file ActionStack.cs.

bool SiliconStudio.ActionStack.ActionStack.UndoRedoInProgress
getsetprotected

Gets whether an undo/redo operation is currently in progress.

Definition at line 96 of file ActionStack.cs.

Event Documentation

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.


The documentation for this class was generated from the following file: