Constructors
Properties
Current
#Gets the document at the head of the current stack. If no document is currently available, a new, inactive document will be created.
Indexers
Methods
Contains
#Test whether a specific file path is part of this stack. Note that only root files ought to have file paths which means only root files are checked, even if they are not at the head of the stack.
Parameters:
| filePath (string) |
CreateLastChanceSaveDialog
#public Dialog CreateLastChanceSaveDialog()
Return a dialog which contains a list of unsaved documents that cannot be silently restored on next launch (currently: documents that have never been saved). Returns null if no such documents exist. Documents that have a file path are handled via the session record and the autosave flush in FlushModifiedAutoSavesForShutdown().
FlushModifiedAutoSavesForShutdown
#public void FlushModifiedAutoSavesForShutdown()
Force-flush an up-to-date autosave file to disk for every modified document in the bag that has been saved at least once. Intended to be called during shutdown so that the next launch can reinstate those documents from their autosave files via the session record.
Index
#Gets the index of the document with the specified file path within this stack, or -1. Note that only root files ought to have file paths which means only root files are checked, even if they are not at the head of the stack.
Parameters:
| filePath (string) |
PathSequence
#Create a single string which sequences all the paths of all documents which have paths.
Pop
#Remove a document from this stack. If the popped document is the current one, the next one will be made current. Only documents which are at the heads of their respective stacks can be popped.
Push
#Push a document to this bag and make it current.
Queue
#Push a document to the end of this stack. If the document is already in the stack, but not at the end, it will *not* be repositioned.
RegisterAcceptHandler
#Add a callback to a specific document for acceptance handling.
RegisterRejectHandler
#Add a callback to a specific document for rejection handling.
SuspendEvents
#Suspend external firing of the Changed event for the lifetime of the returned scope. Internal bookkeeping (such as the active-head Document.ModifiedChanged subscription) still keeps up with the bag's state. When the outermost scope is disposed, a single DocumentBagEventType.Restored event is fired so subscribers that build state incrementally can re-sync from scratch. Nestable: only the outermost scope's disposal fires the Restored event.
TryOpenDocument
#Load a Grasshopper file into this canvas.
Parameters:
| file (string) | |
| options (OpenDocumentOptions) |
Returns: True if the file was successfully loaded.