RuntimeDocumentDataTableGetValueT Method |
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.
Namespace:
Rhino.DocObjects.Tables
Assembly:
RhinoCommon (in RhinoCommon.dll)
Syntax public T GetValue<T>(
Object key,
Func<RhinoDoc, T> newT
)
where T : class
Public Function GetValue(Of T As Class) (
key As Object,
newT As Func(Of RhinoDoc, T)
) As T
Parameters
- key
- Type: SystemObject
Key to search for.
- newT
- Type: SystemFuncRhinoDoc, T
Function called to create new value
Type Parameters
- T
-
Class type created as necessary and returned.
Return Value
Type:
T
Returns the document specific instance of type T using the specified
dictionary key.
Examples
var data = doc?.RuntimeData.GetValue(typeof(MyClass), rhinoDoc => new MyClass(rhinoDoc));
See Also