NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

FieldBuilder.SetValue

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
);

Parameters

obj
The object on which to access the field.
val
The value to assign to the field.
invokeAttr
A member of IBinder that specifies the type of binding that is desired (for example, IBinder.CreateInstance, IBinder.ExactBinding).
binder
A set of properties and enabling for binding, coercion of argument types, and invocation of members via reflection. If binder is null, then IBinder.DefaultBinding is used.
culture
The software preferences of a particular culture

Exceptions

Exception Type Condition
NotSupportedException . This method is not supported in this preliminary release of the NGWS SDK.

Remarks

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.

See Also

FieldBuilder Class | FieldBuilder Members | System.Reflection.Emit Namespace