GH_DocumentServer Class

GH_DocumentServer Class

Manages and maintains a collection of GH_Documents.
Inheritance Hierarchy
SystemObject
  Grasshopper.KernelGH_DocumentServer

Namespace:  Grasshopper.Kernel
Assembly:  Grasshopper (in Grasshopper.dll)
Syntax
public sealed class GH_DocumentServer : IEnumerable<GH_Document>
Public NotInheritable Class GH_DocumentServer
	Implements IEnumerable(Of GH_Document)

The GH_DocumentServer type exposes the following members.

Constructors
  NameDescription
Public methodGH_DocumentServer
Initializes a new instance of the GH_DocumentServer class
Top
Properties
  NameDescription
Public propertyDocument
Gets the document at the given index.
Public propertyDocumentCount
Gets the number of documents stored in the global list.
Public propertyDocumentNames
Gets a string collection containing all the names of the documents in the global list.
Public propertyModifiedDocumentCount
Gets the total number of modified (unsaved) documents.
Top
Methods
  NameDescription
Public methodAddDocument(GH_Document)
Add a new document to the global list. If the document is already registered nothing will happen.
Public methodAddDocument(String, Boolean)
Add a new document to the global list. If there already is a document with the given path, it will be made active.
Public methodAddNewDocument
Adds a new document to the global list. If a template file has been set, this document will be based on the template.
Public methodContains
Gets a value indicating whether or not the given document is inside the list.
Public methodGetEnumerator
Public methodGetEnumerator_Generic
Public methodIndexOf(String)
Gets the index of the document that matches the filepath.
Public methodIndexOf(GH_Document)
Gets the index of the given document.
Public methodIndexOfAutoSave
Gets the document index that is associated with the specified autosave location.
Public methodNextAvailableDocument
Gets the most important, non-active document.
Public methodPromoteDocument
Push a document to the top of the list, meaning it will be first in line when a new default document needs to be selected.
Public methodRemoveAllDocuments
Remove all documents in the global list.
Public methodRemoveDocument
Removes a specific document from the global list. If the document isn't registered nothing will happen. If the document is owned by an IGH_DocumentOwner, the owner will be informed of the removal.
Public methodSafeRemoveDocument
Remove a document correctly from the server. This method shows user-interface prompts if there is unsaved data and will also save if needed.
Top
Events
See Also