|
ValueExpressionParserTCreateInstanceTExpressionScope(IEnumerablePropertyInfo, TypeRegistry) Method
|
Namespace: GSF.ComponentModelAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.250-beta+e1aac152bf9c38c67035c6d283461f222e39e02a
Syntax
Remarks
This function is useful for generating a delegate to a compiled function that will create new
objects of type
T where properties of the type of have been decorated with
DefaultValueAttribute or
DefaultValueExpressionAttribute attributes.
The newly created object will automatically have applied any defined default values as specified by
the encountered attributes. The generated delegate takes a parameter to a contextual object useful
for providing extra runtime data to
DefaultValueExpressionAttribute attributes; the
parameter must be derived from
IValueExpressionScopeT. Any public fields,
methods or properties defined in the derived class will be automatically accessible from the
expressions declared in the
DefaultValueExpressionAttribute attributes. By default,
the expressions will have access to the current
T instance by referencing the
this keyword, which is an alias to
Instance.
Note |
---|
This function will assign evaluated expression values to properties in a newly created model.
|
See Also