GH_UndoServer

References
Provides access to a documents undo data.

Constructors

GH_UndoServer

#
public GH_UndoServer(GH_Document owner)
owner (GH_Document)

Properties

FirstRedoName

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

FirstUndoName

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

MaxRecords

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

RedoCount

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

RedoGuids

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

RedoNames

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

UndoCount

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

UndoGuids

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

UndoNames

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

Methods

AppendToDebugLog

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

Clear

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

ClearRedo

#
public void ClearRedo()
Clear the undo list.

ClearUndo

#
public void ClearUndo()
Clear the redo list.

MergeRecords

#
public bool MergeRecords(int count)
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.
count (int)Number of most recent records to merge.
True if merge was successful.

PerformRedo

#
public void 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.

PerformUndo

#
public void 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.

PushUndoRecord

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

PushUndoRecord

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

RemoveRecord

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