FieldAccessorSetInstanceValueTInstance, TField(TInstance, TField) Method
Sets 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
Set method can be used.
Namespace: KGySoft.ReflectionAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
public void SetInstanceValue<TInstance, TField>(
in TInstance instance,
TField value
)
where TInstance : struct, new()
Public Sub SetInstanceValue(Of TInstance As {Structure, New}, TField) (
ByRef instance As TInstance,
value As TField
)
public:
generic<typename TInstance, typename TField>
where TInstance : value class, gcnew()
void SetInstanceValue(
[InAttribute] TInstance% instance,
TField value
)
member SetInstanceValue :
instance : 'TInstance byref *
value : 'TField -> unit when 'TInstance : struct, new()
- instance TInstance
- The instance that the field belongs to.
- value TField
- The value to set.
- TInstance
- The type of the instance that declares the field.
- TField
- The type of the field.