Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PropertyBuilder::SetValue Method (Object^, Object^, BindingFlags, Binder^, array<Object^>^, CultureInfo^)

 

Sets the property value for the given object to the given value.

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

public:
virtual void SetValue(
	Object^ obj,
	Object^ value,
	BindingFlags invokeAttr,
	Binder^ binder,
	array<Object^>^ index,
	CultureInfo^ culture
) override

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 is to 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 using reflection. If binder is null, the default binder is used.

index
Type: array<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 is to 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.

Exception Condition
NotSupportedException

This method is not supported.

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

.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Return to top
Show:
© 2017 Microsoft