RuntimeDocumentDataTable

Dictionary<2>References
Collection of document runtime data. This is a good place to put non-serialized, per document data.

Properties

Document

#Since v6.3
public RhinoDoc Document { get; }

Methods

GetValue<T>

#
Checks the dictionary for the specified key, if found and the value is not null then the value is returned. If the key is not found or its value is null then newT(Document) is called to create a new value instance which is put in the dictionary and returned.
public T GetValue<T>(
key,
Key to search for.
newT
Function called to create new value
)
Returns the document specific instance of type T using the specified dictionary key.
var data = doc?.RuntimeData.GetValue(typeof(MyClass), rhinoDoc => new MyClass(rhinoDoc));

TryGetValue<T>

#Since v6.15
Check dictionary for value and return it properly cast if found.
public T TryGetValue<T>(
key
Key to search for.
)
Returns the document specific instance of type T using the specified dictionary key or null if not found.