# UndoList<T> class

Namespace: [Grasshopper2.Collections](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.collections.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public class UndoList<T>
```

Provides an undo/redo list mechanism.

**Type parameters:**

- `T`: Type constraint.

## Constructors

- [UndoList<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/ctor.md): Create a new undo/redo list.

## Properties

- [CanRedo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/canredo.md): Gets whether a redo operation is possible.
- [CanUndo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/canundo.md): Gets whether an undo operation is possible.
- [Current](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/current.md): Gets or sets the current state. When set, the redo list will be cleared and the current "current" state will be pushing onto the undo stack.
- [RedoCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/redocount.md): Gets the number of redo records.
- [RedoRecords](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/redorecords.md): Enumerates over all redo records, starting with the most recent one.
- [UndoCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/undocount.md): Gets the number of undo records.
- [UndoRecords](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/undorecords.md): Enumerates over all undo records, starting with the most recent one.

## Methods

- [Clear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/clear.md): (2 overloads) Erase all undo and redo records.
- [FirstRedoRecord](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/firstredorecord.md): Gets the first redo record, if any.
- [FirstUndoRecord](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/firstundorecord.md): Gets the first undo record, if any.
- [PerformRedo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/performredo.md): Perform a single redo step. This will move a the current state onto the undo stack and pop the most recent redo record into the current state.
- [PerformUndo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/performundo.md): Perform a single undo step. This will move the current state onto the redo stack and pop the most recent undo record into the current state.
- [SetCurrentQuietly](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1/setcurrentquietly.md): Set the current state without affecting the undo and redo stacks. Use this method if you wish to update the current state without recording an undo record.
