FormatterServices.PopulateObjectMembers Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Populates the specified object with values for each field drawn from the data array of objects.
public:
static System::Object ^ PopulateObjectMembers(System::Object ^ obj, cli::array <System::Reflection::MemberInfo ^> ^ members, cli::array <System::Object ^> ^ data);
public static object PopulateObjectMembers (object obj, System.Reflection.MemberInfo[] members, object?[] data);
public static object PopulateObjectMembers (object obj, System.Reflection.MemberInfo[] members, object[] data);
[System.Security.SecurityCritical]
public static object PopulateObjectMembers (object obj, System.Reflection.MemberInfo[] members, object[] data);
static member PopulateObjectMembers : obj * System.Reflection.MemberInfo[] * obj[] -> obj
[<System.Security.SecurityCritical>]
static member PopulateObjectMembers : obj * System.Reflection.MemberInfo[] * obj[] -> obj
Public Shared Function PopulateObjectMembers (obj As Object, members As MemberInfo(), data As Object()) As Object
Parameters
- obj
- Object
The object to populate.
- members
- MemberInfo[]
An array of MemberInfo that describes which fields and properties to populate.
Returns
The newly populated object.
- Attributes
Exceptions
The length of members
does not match the length of data
.
An element of members
is not an instance of FieldInfo.
The caller does not have the required permission.
Remarks
If an element in data
is null
, PopulateObjectMembers does not write anything to that field.