Export (0) Print
Expand All

_PropertyInfo.SetValue Method (Object, Object, BindingFlags, Binder, Object[], CultureInfo)

Provides COM objects with version-independent access to the SetValue method.

Namespace:  System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

void SetValue(
	Object obj,
	Object value,
	BindingFlags invokeAttr,
	Binder binder,
	Object[] index,
	CultureInfo culture
)

Parameters

obj
Type: System.Object

The object whose property value will be returned.

value
Type: System.Object

The new value for this property.

invokeAttr
Type: System.Reflection.BindingFlags

The invocation attribute. This must be a bit flag from BindingFlags: InvokeMethod, CreateInstance, Static, GetField, SetField, GetProperty, or SetProperty. A suitable invocation attribute must be specified. If a static member will be invoked, the Static flag of BindingFlags must be set.

binder
Type: System.Reflection.Binder

An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects through reflection. If binder is null, the default binder is used.

index
Type: System.Object[]

Optional index values for indexed properties. This value should be null for non-indexed properties.

culture
Type: System.Globalization.CultureInfo

The CultureInfo object that represents the culture for which the resource will be localized. Note that if the resource is not localized for this culture, the CultureInfo.Parent method will be called successively in search of a match. If this value is null, the CultureInfo is obtained from the CultureInfo.CurrentUICulture property.

This method is for access to managed classes from unmanaged code and should not be called from managed code.

The SetValue method sets the property value for the given object to the given value.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft