ScriptObject.WrapMembers 方法

定义

创建“被包装”对象。Creates wrapped objects. 每个被包装对象都包含一个成员(字段、属性或方法)的信息,以及作为成员定义依据的实例化对象的副本。Each wrapped object contains the information for one member (field, property, or method), together with a copy of the instantiated object that the member is defined on. 这样,不包含成员的其他对象将能够存储成员,然后返回成员的值,就好像成员是自己的成员一样。This enables other objects that do not contain the member to store it and then return its value as if it were their own.

重载

WrapMembers(MemberInfo, Object)

此 API 支持产品基础结构,不能在代码中直接使用。

创建一个包含指定成员以及指定对象的被包装对象。Creates a wrapped object that contains the specified member together with the specified object.

WrapMembers(MemberInfo[], Object)

此 API 支持产品基础结构,不能在代码中直接使用。

创建被包装对象(其中包含指定的成员以及指定的对象)的数组。Creates an array of wrapped objects that contain the specified members together with the specified object.

WrapMembers(MemberInfo[], Object, SimpleHashtable)

此 API 支持产品基础结构,不能在代码中直接使用。

创建被包装对象(其中包含指定的成员以及指定的对象)的数组,并将结果缓存在指定的数据存储中。Creates an array of wrapped objects that contain the specified members together with the specified object, caching the results in the specified data storage.

WrapMembers(MemberInfo, Object)

创建一个包含指定成员以及指定对象的被包装对象。Creates a wrapped object that contains the specified member together with the specified object.

此 API 支持产品基础结构,不能在代码中直接使用。

protected:
 static cli::array <System::Reflection::MemberInfo ^> ^ WrapMembers(System::Reflection::MemberInfo ^ member, System::Object ^ obj);
protected static System.Reflection.MemberInfo[] WrapMembers (System.Reflection.MemberInfo member, object obj);
static member WrapMembers : System.Reflection.MemberInfo * obj -> System.Reflection.MemberInfo[]
Protected Shared Function WrapMembers (member As MemberInfo, obj As Object) As MemberInfo()

参数

member
MemberInfo

要包装的成员。The member to wrap.

obj
Object

在其上定义 member 的对象。The object that member is defined on.

返回

MemberInfo[]

一个具有被包装对象的一元素数组,该被包装对象包含成员信息和 objA one-element array that has a wrapped object that contains the member information and obj.

注解

此方法允许不包含成员的其他对象存储该成员,并返回其值,就像它是自己的值一样。This method enables other objects that do not contain the member to store it and then return its value as if it were their own.

另请参阅

适用于

WrapMembers(MemberInfo[], Object)

创建被包装对象(其中包含指定的成员以及指定的对象)的数组。Creates an array of wrapped objects that contain the specified members together with the specified object.

此 API 支持产品基础结构,不能在代码中直接使用。

protected:
 static cli::array <System::Reflection::MemberInfo ^> ^ WrapMembers(cli::array <System::Reflection::MemberInfo ^> ^ members, System::Object ^ obj);
protected static System.Reflection.MemberInfo[] WrapMembers (System.Reflection.MemberInfo[] members, object obj);
static member WrapMembers : System.Reflection.MemberInfo[] * obj -> System.Reflection.MemberInfo[]
Protected Shared Function WrapMembers (members As MemberInfo(), obj As Object) As MemberInfo()

参数

members
MemberInfo[]

要包装的成员。The members to wrap.

obj
Object

在其上定义 members 的对象。The object that members are defined on.

返回

MemberInfo[]

被包装对象的数组,每个被包装对象均包含成员信息和 obj 的副本。An array of wrapped objects, each of which contains member information and a copy of obj.

注解

此方法允许不包含这些成员的其他对象存储它们,然后返回它们的值,就像它们是自己的值一样。This method enables other objects that do not contain these members to store them and then return their values as if they were their own.

另请参阅

适用于

WrapMembers(MemberInfo[], Object, SimpleHashtable)

创建被包装对象(其中包含指定的成员以及指定的对象)的数组,并将结果缓存在指定的数据存储中。Creates an array of wrapped objects that contain the specified members together with the specified object, caching the results in the specified data storage.

此 API 支持产品基础结构,不能在代码中直接使用。

protected:
 static cli::array <System::Reflection::MemberInfo ^> ^ WrapMembers(cli::array <System::Reflection::MemberInfo ^> ^ members, System::Object ^ obj, Microsoft::JScript::SimpleHashtable ^ cache);
protected static System.Reflection.MemberInfo[] WrapMembers (System.Reflection.MemberInfo[] members, object obj, Microsoft.JScript.SimpleHashtable cache);
static member WrapMembers : System.Reflection.MemberInfo[] * obj * Microsoft.JScript.SimpleHashtable -> System.Reflection.MemberInfo[]
Protected Shared Function WrapMembers (members As MemberInfo(), obj As Object, cache As SimpleHashtable) As MemberInfo()

参数

members
MemberInfo[]

要包装的成员。The members to wrap.

obj
Object

在其上定义 members 的对象。The object that members are defined on.

cache
SimpleHashtable

被包装对象的临时数据存储。Temporary data storage for the wrapped objects.

返回

MemberInfo[]

被包装对象的数组,每个被包装对象均包含成员信息和 obj 的副本。An array of wrapped objects, each of which contains member information and a copy of obj.

注解

此方法允许不包含这些成员的其他对象存储它们,然后返回它们的值,就像它们是自己的值一样。This method enables other objects that do not contain these members to store them and then return their values as if they were their own.

另请参阅

适用于