Table of Contents

Class UndoStack

Namespace
Icy.Design
Assembly
IcyUI.Design.dll

The undo and redo history of one DesignDocument's edits.

public sealed class UndoStack
Inheritance
UndoStack
Inherited Members
Extension Methods

Remarks

Undoing restores the text byte for byte and mirrors the change onto the live pages, like any edit. An element that comes back after its removal is undone is built fresh; a moved element that is moved back keeps its identity.

Group several edits into one step with BeginTransaction(string).

Properties

CanRedo

Gets a value indicating whether there is a step to redo.

public bool CanRedo { get; }

Property Value

bool

CanUndo

Gets a value indicating whether there is a step to undo.

public bool CanUndo { get; }

Property Value

bool

CoalesceWindow

Gets or sets how close together repeated sets of the same attribute must be to merge into one undo step, as during a drag. 500 ms by default.

public TimeSpan CoalesceWindow { get; set; }

Property Value

TimeSpan

RedoDescription

Gets a description of the step Redo() would redo, or null.

public string? RedoDescription { get; }

Property Value

string

UndoDescription

Gets a description of the step Undo() would undo, or null.

public string? UndoDescription { get; }

Property Value

string

Methods

Clear()

Forgets the whole history.

public void Clear()

Redo()

Redoes the latest undone step.

public EditResult Redo()

Returns

EditResult

The outcome; a failure when there is nothing to redo.

Exceptions

InvalidOperationException

A transaction is open.

ObjectDisposedException

The document's session was disposed.

Undo()

Undoes the latest step.

public EditResult Undo()

Returns

EditResult

The outcome; a failure when there is nothing to undo.

Exceptions

InvalidOperationException

A transaction is open.

ObjectDisposedException

The document's session was disposed.

Events

Changed

Occurs when the history changed: an edit was recorded, or a step was undone or redone.

public event EventHandler? Changed

Event Type

EventHandler