AccessibleObject.IReflect.InvokeMember Method (String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[])


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

This API supports the product infrastructure and is not intended to be used directly from your code.

Invokes a specified member. For a description of this member, see IReflect.InvokeMember.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

object IReflect.InvokeMember(
	string name,
	BindingFlags invokeAttr,
	Binder binder,
	object target,
	object[] args,
	ParameterModifier[] modifiers,
	CultureInfo culture,
	string[] namedParameters


Type: System.String

The name of the member to find.

Type: System.Reflection.BindingFlags

One of the System.Reflection.BindingFlags invocation attributes.

Type: System.Reflection.Binder

One of the System.Reflection.BindingFlags bit flags. Implements Binder, containing properties related to this method.

Type: System.Object

The object on which to invoke the specified member. This parameter is ignored for static members.

Type: System.Object[]

An array of objects that contains the number, order, and type of the parameters of the member to be invoked. This is an empty array if there are no parameters.

Type: System.Reflection.ParameterModifier[]

An array of System.Reflection.ParameterModifier objects.

Type: System.Globalization.CultureInfo

An instance of System.Globalization.CultureInfo used to govern the coercion of types.

Type: System.String[]

A String array of parameters.

Return Value

Type: System.Object

The specified member.

Exception Condition

invokeAttr is BindingFlags.CreateInstance and another bit flag is also set.


invokeAttr is not BindingFlags.CreateInstance and name is null.


invokeAttr is not an invocation attribute from System.Reflection.BindingFlags.


invokeAttr specifies both get and set for a property or field.


invokeAttr specifies both a field set and an Invoke method. args is provided for a field get operation.


More than one argument is specified for a field set operation.


The field or property cannot be found.


The method cannot be found.


A private member is invoked without the necessary System.Security.Permissions.ReflectionPermission.

The invokeAttr parameter may be a constructor, method, property, or field. A suitable invocation attribute must be specified. Invoke the default member of a class by passing the empty string ("") as the name of the member.

The modifiers parameter has the same length as the args parameter, representing the invoked member's argument attributes in the metadata. A parameter can have the following attributes: pdIn, pdOut, pdRetval, pdOptional, and pdHasDefault. These represent [In], [Out], [retval], [optional], and a default parameter, respectively.

This member is an explicit interface member implementation. It can be used only when the AccessibleObject instance is cast to an IReflect interface.

.NET Framework
Available since 1.1
Return to top