Show / Hide Table of Contents

# Class UndoManager

Undo-redo interface; one-to-one mapped to document

##### Inheritance

object
UndoManager

##### Implements

IDisposable

##### Inherited Members

object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

###### Namespace: pdftron.SDF

###### Assembly: PDFTronDotNet.dll

##### Syntax

    public class UndoManager : IDisposable

### Constructors

#### UndoManager(IntPtr)

##### Declaration

    public UndoManager(IntPtr impl_ptr)

##### Parameters

Type | Name | Description
--- | --- | ---
IntPtr | impl_ptr |

### Methods

#### CanRedo()

Returns a boolean indicating whether it is possible to redo from the current snapshot.

##### Declaration

    public bool CanRedo()

##### Returns

Type | Description
--- | ---
bool | A boolean indicating whether it is possible to redo from the current snapshot

#### CanUndo()

Returns whether it is possible to undo from the current snapshot.

##### Declaration

    public bool CanUndo()

##### Returns

Type | Description
--- | ---
bool | Whether it is possible to undo from the current snapshot

#### Destroy()

##### Declaration

    public void Destroy()

#### DiscardAllSnapshots()

Forget all changes in this manager (without changing the document).

##### Declaration

    public DocSnapshot DiscardAllSnapshots()

##### Returns

Type | Description
--- | ---
DocSnapshot | An invalid DocSnapshot

#### Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

##### Declaration

    public void Dispose()

#### Dispose(bool)

##### Declaration

    protected virtual void Dispose(bool disposing)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | disposing |

#### ~UndoManager()

##### Declaration

    protected ~UndoManager()

#### GetNextRedoSnapshot()

Gets the next state of the document. This state may be invalid if it is impossible to redo.

##### Declaration

    public DocSnapshot GetNextRedoSnapshot()

##### Returns

Type | Description
--- | ---
DocSnapshot | The next state of the document. This state may be invalid if it is impossible to redo

#### GetNextUndoSnapshot()

Gets the previous state of the document. This state may be invalid if it is impossible to undo.

##### Declaration

    public DocSnapshot GetNextUndoSnapshot()

##### Returns

Type | Description
--- | ---
DocSnapshot | The previous state of the document. This state may be invalid if it is impossible to undo

#### Redo()

Restores to the next snapshot, if there is one.

##### Declaration

    public ResultSnapshot Redo()

##### Returns

Type | Description
--- | ---
ResultSnapshot | A representation of the transition to the next snapshot, if there is one

#### TakeSnapshot()

Creates a snapshot of document state, transitions to the new snapshot.

##### Declaration

    public ResultSnapshot TakeSnapshot()

##### Returns

Type | Description
--- | ---
ResultSnapshot | A representation of the transition

#### Undo()

Restores to the previous snapshot point, if there is one.

##### Declaration

    public ResultSnapshot Undo()

##### Returns

Type | Description
--- | ---
ResultSnapshot | The resulting snapshot id

### Implements

IDisposable