Class Undo
The undo/redo actions recording object.
Implements
Namespace: FlaxEditor
Assembly: FlaxEngine.CSharp.dll
Syntax
public class Undo : Object, IDisposable
Constructors
Undo(Int32)
Initializes a new instance of the Undo class.
Declaration
public Undo(int historyActionsLimit = 1000)
Parameters
System.Int32
historyActionsLimit
The history actions limit. |
Properties
CanRedo
Gets a value indicating whether can do redo on last undone action.
Declaration
public bool CanRedo { get; }
Property Value
System.Boolean
|
CanUndo
Gets a value indicating whether can do undo on last performed action.
Declaration
public bool CanUndo { get; }
Property Value
System.Boolean
|
Capacity
Gets or sets the capacity of the undo history buffers.
Declaration
public int Capacity { get; set; }
Property Value
System.Int32
|
Enabled
Gets or sets a value indicating whether this Undo is enabled.
Declaration
public virtual bool Enabled { get; set; }
Property Value
System.Boolean
|
FirstRedoName
Gets the first name of the redo action.
Declaration
public string FirstRedoName { get; }
Property Value
System.String
|
FirstUndoName
Gets the first name of the undo action.
Declaration
public string FirstUndoName { get; }
Property Value
System.String
|
UndoOperationsStack
Gets the undo operations stack.
Declaration
public HistoryStack UndoOperationsStack { get; }
Property Value
HistoryStack
|
Methods
add_ActionDone(Undo.UndoEventDelegate)
Declaration
public void add_ActionDone(Undo.UndoEventDelegate value)
Parameters
Undo.UndoEventDelegate
value
|
add_RedoDone(Undo.UndoEventDelegate)
Declaration
public void add_RedoDone(Undo.UndoEventDelegate value)
Parameters
Undo.UndoEventDelegate
value
|
add_UndoDone(Undo.UndoEventDelegate)
Declaration
public void add_UndoDone(Undo.UndoEventDelegate value)
Parameters
Undo.UndoEventDelegate
value
|
AddAction(IUndoAction)
Adds the action to the history.
Declaration
public void AddAction(IUndoAction action)
Parameters
IUndoAction
action
The action. |
Clear()
Clears the history.
Declaration
public void Clear()
Dispose()
Declaration
public void Dispose()
OnAction(IUndoAction)
Called when Undo performs action.
Declaration
protected virtual void OnAction(IUndoAction action)
Parameters
IUndoAction
action
The action. |
OnRedo(IUndoAction)
Called when Undo performs redo action.
Declaration
protected virtual void OnRedo(IUndoAction action)
Parameters
IUndoAction
action
The action. |
OnUndo(IUndoAction)
Called when Undo performs undo action.
Declaration
protected virtual void OnUndo(IUndoAction action)
Parameters
IUndoAction
action
The action. |
PerformRedo()
Redo last undone action
Declaration
public void PerformRedo()
PerformUndo()
Undo last recorded action
Declaration
public void PerformUndo()
RecordAction(Object, String, Action)
Creates new undo action for provided instance of object.
Declaration
public void RecordAction(object snapshotInstance, string actionString, Action actionsToSave)
Parameters
System.Object
snapshotInstance
Instance of an object to record |
System.String
actionString
Name of action to be displayed in undo stack. |
System.Action
actionsToSave
Action in after witch recording will be finished. |
RecordAction(Object, String, Action<Object>)
Creates new undo action for provided instance of object.
Declaration
public void RecordAction(object snapshotInstance, string actionString, Action<object> actionsToSave)
Parameters
System.Object
snapshotInstance
Instance of an object to record |
System.String
actionString
Name of action to be displayed in undo stack. |
System.Action<System.Object>
actionsToSave
Action in after witch recording will be finished. |
RecordAction<T>(T, String, Action<T>)
Creates new undo action for provided instance of object.
Declaration
public void RecordAction<T>(T snapshotInstance, string actionString, Action<T> actionsToSave)
where T : new()
Parameters
T
snapshotInstance
Instance of an object to record |
System.String
actionString
Name of action to be displayed in undo stack. |
System.Action<T>
actionsToSave
Action in after witch recording will be finished. |
Type Parameters
T
|
RecordBegin(Object, String)
Begins recording for undo action.
Declaration
public void RecordBegin(object snapshotInstance, string actionString)
Parameters
System.Object
snapshotInstance
Instance of an object to record. |
System.String
actionString
Name of action to be displayed in undo stack. |
RecordEnd(Object, IUndoAction, IUndoAction)
Ends recording for undo action.
Declaration
public void RecordEnd(object snapshotInstance = null, IUndoAction customActionBefore = null, IUndoAction customActionAfter = null)
Parameters
System.Object
snapshotInstance
Instance of an object to finish recording, if null take last provided. |
IUndoAction
customActionBefore
Custom action to append to the undo block action before recorded modifications apply. |
IUndoAction
customActionAfter
Custom action to append to the undo block action after recorded modifications apply. |
RecordMultiBegin(Object[], String)
Begins recording for undo action.
Declaration
public void RecordMultiBegin(object[] snapshotInstances, string actionString)
Parameters
System.Object[]
snapshotInstances
Instances of objects to record. |
System.String
actionString
Name of action to be displayed in undo stack. |
RecordMultiEnd(Object[], IUndoAction, IUndoAction)
Ends recording for undo action.
Declaration
public void RecordMultiEnd(object[] snapshotInstance = null, IUndoAction customActionBefore = null, IUndoAction customActionAfter = null)
Parameters
System.Object[]
snapshotInstance
Instance of an object to finish recording, if null take last provided. |
IUndoAction
customActionBefore
Custom action to append to the undo block action before recorded modifications apply. |
IUndoAction
customActionAfter
Custom action to append to the undo block action after recorded modifications apply. |
remove_ActionDone(Undo.UndoEventDelegate)
Declaration
public void remove_ActionDone(Undo.UndoEventDelegate value)
Parameters
Undo.UndoEventDelegate
value
|
remove_RedoDone(Undo.UndoEventDelegate)
Declaration
public void remove_RedoDone(Undo.UndoEventDelegate value)
Parameters
Undo.UndoEventDelegate
value
|
remove_UndoDone(Undo.UndoEventDelegate)
Declaration
public void remove_UndoDone(Undo.UndoEventDelegate value)
Parameters
Undo.UndoEventDelegate
value
|
Events
ActionDone
Occurs when action is done and appended to the Undo.
Declaration
public event Undo.UndoEventDelegate ActionDone
Event Type
Undo.UndoEventDelegate
|
RedoDone
Occurs when redo operation is done.
Declaration
public event Undo.UndoEventDelegate RedoDone
Event Type
Undo.UndoEventDelegate
|
UndoDone
Occurs when undo operation is done.
Declaration
public event Undo.UndoEventDelegate UndoDone
Event Type
Undo.UndoEventDelegate
|