共用方式為


PropertyBuilder.SetValue Method (Object, Object, array<Object[])

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Sets the value of the property with optional index values for index properties. This method is not supported.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Overrides Sub SetValue ( _
    obj As Object, _
    value As Object, _
    index As Object() _
)
public override void SetValue(
    Object obj,
    Object value,
    Object[] index
)

Parameters

  • obj
    Type: System.Object
    The object whose property value will be set.
  • index
    Type: array<System.Object[]
    Optional index values for indexed properties. This value should be nulla null reference (Nothing in Visual Basic) for non-indexed properties.

Exceptions

Exception Condition
NotSupportedException

This method is not supported.

Remarks

To set the value of a property, reflect on the property's parent type after the type is completed, using Type.GetType or Assembly.GetType. Retrieve the PropertyInfo object from the type, and call PropertyInfo.SetValue.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.