Api Sandbox Helpers UndoSystem
class

UndoSystem

public class UndoSystem

A system that aims to wrap the main reusable functionality of an undo system

Constructors

UndoSystem()

Properties

Name Type Description
Back Stack<Entry> Backwards stack
Forward Stack<Entry> Forwards stack, gets cleared when a new undo is added

Methods

Boolean Undo()

Instigate an undo. Return true if we found a successful undo

Boolean Redo()

Instigate a redo, returns true if we found a successful undo

Entry Insert(String title, Action undo, Action redo = null)

Insert a new undo entry

Void SetSnapshotFunction(Func<Action> snapshot)
Void Snapshot(String changeTitle)

Should be called after you make a change to your project. The snapshot system is good for self contained projects that can be serialized and deserialized quickly.

Void Initialize()

Clear the history and take an initial snapshot. You should call this right after a load, or a new project.

Fields

Name Type Description
OnUndo Action<Entry> Called when an undo is run
OnRedo Action<Entry> Called when a redo is run
Assembly: Sandbox.Tools Namespace: Sandbox.Helpers Full Name: Sandbox.Helpers.UndoSystem