PropertyAccessorSet(Object, Object) Method

Sets the property with no index parameters. For static properties the instance parameter is omitted (can be ).
See the Remarks section of the Set(Object, Object, Object) overload for details.

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public void Set(
	Object? instance,
	Object? value
)

Parameters

instance  Object
The instance that the property belongs to. Can be for static properties.
value  Object
The value to set.

Exceptions

ArgumentNullExceptionThis PropertyAccessor represents an instance property and instance is
-or-
This PropertyAccessor represents a value type property and value is .
ArgumentExceptionThe type of instance or value is invalid.
-or-
The property expects index parameters.
InvalidOperationExceptionThe PropertyAccessor represents a property of an open generic type.
NotSupportedExceptionThis PropertyAccessor represents a read-only property.
-or-
On .NET Framework the code is executed in a partially trusted domain with insufficient permissions.
PlatformNotSupportedExceptionYou use the .NET Standard 2.0 build of KGySoft.CoreLibraries and this PropertyAccessor represents a ref property.

See Also