GH_UndoServer

References
Provides access to a documents undo data.

Constructors

GH_UndoServer

#
public GH_UndoServer()

Properties

FirstRedoName

#
Gets the name of the last item in the redo stack (the first item to be redone).
public string FirstRedoName { get; }

FirstUndoName

#
Gets the name of the last item in the undo stack (the first item to be undone).
public string FirstUndoName { get; }

MaxRecords

#
Gets or sets the maximum number of undo records that can be stored.
public int MaxRecords { get; set; }
Remarks: The number of redo records is logically limited to the same number. THIS SETTING IS CURRENTLY IGNORED

RedoCount

#
Number of redo records currently in the stack.
public int RedoCount { get; }

RedoGuids

#
Gets a sorted list of all the redo Guids in this server.
public List<Guid> RedoGuids { get; }

RedoNames

#
Gets a sorted list of all the redo Guids in this server.
public List<string> RedoNames { get; }

UndoCount

#
Number of undo records currently in the stack.
public int UndoCount { get; }

UndoGuids

#
Gets a sorted list of all the undo Guids in this server.
public List<Guid> UndoGuids { get; }

UndoNames

#
Gets a sorted list of all the undo Guids in this server.
public List<string> UndoNames { get; }

Methods

AppendToDebugLog

#
[EditorBrowsable(EditorBrowsableState.Advanced)] public void AppendToDebugLog()
AppendToDebugLog

Clear

#
Clear both undo and redo lists.
public void Clear()

ClearRedo

#
Clear the undo list.
public void ClearRedo()

ClearUndo

#
Clear the redo list.
public void ClearUndo()

MergeRecords

#
Attempt to merge the N most recent records into one. The name of the merged record will be identical to the name of the oldest record.
public bool MergeRecords(
count
Number of most recent records to merge.
)
True if merge was successful.

PerformRedo

#
Performs a single Redo step if possible and migrates the record onto the undo stack. This function may throw all kinds of exceptions, if you're calling it from a UI thread, use a Try..Catch block to prevent crashes.
public void PerformRedo()

PerformUndo

#
Performs a single Undo step when possible and migrates the record onto the redo stack. This function may throw all kinds of exceptions, if you're calling it from a UI thread, use a Try..Catch block to prevent crashes.
public void PerformUndo()

PushUndoRecord

#
Add a new undo record to the undo stack, this function clears the Redo stack.
public Guid PushUndoRecord(
name,
Name of undo record.
action
Undo action.
)
The ID of the newly created undo record.

PushUndoRecord

#
Add a new undo record to the undo stack, this function clears the Redo stack.
public void PushUndoRecord(
record
Record to add.
)

RemoveRecord

#
Remove the record with the specified ID from the undo or redo stack.
public bool RemoveRecord(
id
ID of record to remove.
)
True on success, false on failure.