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>

#
public T GetValue<T>(object key, Func<RhinoDoc, T> newT)
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.
key (object)Key to search for.
newT (Func<RhinoDoc, T>)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
public T TryGetValue<T>(object key)
Check dictionary for value and return it properly cast if found.
key (object)Key to search for.
Returns the document specific instance of type T using the specified dictionary key or null if not found.