Class EditHistory¶
Namespace: Apogee.Host.Editing
Assembly: Apogee.Host.dll
The undo and redo history of an editor: commands are executed through it, and it can take them back and do them again. A new command after an undo drops what could have been redone. Consecutive
commands that merge (the many small changes of a drag) are one step until
public sealed class EditHistory
Inheritance¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties¶
CanRedo¶
public bool CanRedo { get; }
Property Value¶
CanUndo¶
public bool CanUndo { get; }
Property Value¶
IsAtSavePoint¶
True when the world is in the state it had at the last
public bool IsAtSavePoint { get; }
Property Value¶
Limit¶
How many steps are kept; the oldest go first.
public int Limit { get; set; }
Property Value¶
RedoName¶
public string? RedoName { get; }
Property Value¶
Steps¶
The steps that can be undone, oldest first.
public IReadOnlyList<string> Steps { get; }
Property Value¶
UndoName¶
public string? UndoName { get; }
Property Value¶
Methods¶
Clear()¶
Forgets every step: a new scene was opened, or the world was restored under the history's feet. The world stays as it is, so a history that was at its save point is still at it and one that was
not stays away from it (the caller follows with
public void Clear()
Execute(IEditCommand)¶
Runs the command and records it, folding it into the last step when that allows it and no
public void Execute(IEditCommand command)
Parameters¶
command IEditCommand
MarkSaved()¶
The world was saved in the state it is in now: that is the save point. It also ends the gesture, so a change after the save is a step of its own.
public void MarkSaved()
Redo()¶
public bool Redo()
Returns¶
Seal()¶
Ends the gesture: the following command is a step of its own even if it could merge with the last (a drag was let go of).
public void Seal()
Undo()¶
public bool Undo()
Returns¶
Changed¶
Raised when the history changed (a command ran, undo, redo, clear): the editor marks the scene as modified.
public event Action? Changed