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!

FormatterServices.PopulateObjectMembers

Populate the specified object with values for each field drawn from the data array of objects.

[Visual Basic]
Public Shared Function PopulateObjectMembers( _
   ByVal obj As Object, _
   ByVal members() As MemberInfo, _
   ByVal data() As Object _
) As Object
[C#]
public static object PopulateObjectMembers(
   object obj,
   MemberInfo[] members,
   object[] data
);
[C++]
public: static Object* PopulateObjectMembers(
   Object* obj,
   MemberInfo* members[],
   Object* data[]
);
[JScript]
public static function PopulateObjectMembers(
   obj : Object,
   members : MemberInfo[],
   data : Object[]
) : Object;

Parameters

obj
The object to be populated.
members
An array of MemberInfo describing which fields and properties should be populated.
data
An array of Object specifying the values for each field and property to be populated.

Return Value

The freshly populated object.

Exceptions

Exception Type Condition
ArgumentNullException The obj, members or data parameter is a null reference (in Visual Basic Nothing).

An element of members is a null reference (Nothing).

ArgumentException The length of members does not match the length of data.
SerializationException An element of members is not an instance of FieldInfo.

Remarks

If a matching surrogate for the object can be found, then the populating is handed off to that surrogate. Otherwise, if the object implements ISerializable, the populating is handed off to the object itself. Otherwise, deserialization populates each field listed in members, with the corresponding value listed in data.

If an element in data is a null reference (Nothing), PopulateObjectMembers does not write anything to that field.

See Also

FormatterServices Class | FormatterServices Members | System.Runtime.Serialization Namespace