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;
The freshly populated object.
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. |
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.
FormatterServices Class | FormatterServices Members | System.Runtime.Serialization Namespace