FieldAccessorGetInstanceValueTInstance, TField(TInstance) Method
Gets the strongly typed value of an instance field in a value type.
If the type of the field or the declaring instance is not known at compile time the non-generic
Get method can be used.
Namespace: KGySoft.ReflectionAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
public TField GetInstanceValue<TInstance, TField>(
in TInstance instance
)
where TInstance : struct, new()
Public Function GetInstanceValue(Of TInstance As {Structure, New}, TField) (
ByRef instance As TInstance
) As TField
public:
generic<typename TInstance, typename TField>
where TInstance : value class, gcnew()
TField GetInstanceValue(
[InAttribute] TInstance% instance
)
member GetInstanceValue :
instance : 'TInstance byref -> 'TField when 'TInstance : struct, new()
- instance TInstance
- The instance that the field belongs to.
- TInstance
- The type of the instance that declares the field.
- TField
- The type of the field.
TFieldThe value of the field.