Table of Contents

Method SetValue

Namespace
Microsoft.Samples.Debugging.CorMetadata
Assembly
corapi.dll

SetValue(object, object, BindingFlags, Binder, CultureInfo)

When overridden in a derived class, sets the value of the field supported by the given object.

public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)

Parameters

obj object

The object whose field value will be set.

value object

The value to assign to the field.

invokeAttr BindingFlags

A field of Binder that specifies the type of binding that is desired (for example, Binder.CreateInstance or Binder.ExactBinding).

binder Binder

A set of properties that enables the binding, coercion of argument types, and invocation of members through reflection. If binder is null, then Binder.DefaultBinding is used.

culture CultureInfo

The software preferences of a particular culture.

Exceptions

FieldAccessException

The caller does not have permission to access this field.

TargetException

The obj parameter is null and the field is an instance field.

ArgumentException

The field does not exist on the object.-or- The value parameter cannot be converted and stored in the field.