Sets the value of the field supported by the given object.
[Visual Basic] Overrides Public Sub SetValue( _ ByVal obj As Object, _ ByVal val As Object, _ ByVal invokeAttr As BindingFlags, _ ByVal binder As Binder, _ ByVal culture As CultureInfo _ ) [C#] public override void SetValue( object obj, object val, BindingFlags invokeAttr, Binder binder, CultureInfo culture ); [C++] public: override void SetValue( Object* obj, Object* val, BindingFlags invokeAttr, Binder* binder, CultureInfo* culture ); [JScript] public override function SetValue( obj : Object, val : Object, invokeAttr : BindingFlags, binder : Binder, culture : CultureInfo );
Exception Type | Condition |
---|---|
NotSupportedException | . This method is not supported in this preliminary release of the NGWS SDK. |
This method will assign the val parameter to the field reflected by this instance on object obj. If the field is static, obj will be ignored. For non-static fields, obj should be an instance of a class that inherits or declares the field.
The new value is passed as a Variant. For example, if the field's type is Boolean, an instance of Variant with the appropriate Boolean value is passed. Before setting the value, SetValue checks to see if the user has access permission.
Access restrictions are ignored for fully trusted code. Private constructors, methods, fields, and properties can be accessed and invoked via Reflection whenever the code is fully trusted.
FieldBuilder Class | FieldBuilder Members | System.Reflection.Emit Namespace