Skip to content

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 is called, which the editor does when the gesture ends.

public sealed class EditHistory

Inheritance

object ← EditHistory

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

bool

CanUndo

public bool CanUndo { get; }

Property Value

bool

IsAtSavePoint

True when the world is in the state it had at the last (a new history starts at its save point): undoing back to it, or redoing up to it, is clean again. A state that the pushed out of the history cannot be reached any more, so it is never the save point again until the next .

public bool IsAtSavePoint { get; }

Property Value

bool

Limit

How many steps are kept; the oldest go first.

public int Limit { get; set; }

Property Value

int

RedoName

public string? RedoName { get; }

Property Value

string?

Steps

The steps that can be undone, oldest first.

public IReadOnlyList<string> Steps { get; }

Property Value

IReadOnlyList<string>

UndoName

public string? UndoName { get; }

Property Value

string?

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 when the world now matches a file).

public void Clear()

Execute(IEditCommand)

Runs the command and records it, folding it into the last step when that allows it and no came between.

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

bool

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

bool

Changed

Raised when the history changed (a command ran, undo, redo, clear): the editor marks the scene as modified.

public event Action? Changed

Event Type

Action?