IReflect.InvokeMember Method

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

 

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)

Private Function InvokeMember (
	name As String,
	invokeAttr As BindingFlags,
	binder As Binder,
	target As Object,
	args As Object(),
	modifiers As ParameterModifier(),
	culture As CultureInfo,
	namedParameters As String()
) As Object
	Implements IReflect.InvokeMember

Parameters

name
Type: System.String

The name of the member to find.

invokeAttr
Type: System.Reflection.BindingFlags

One of the System.Reflection.BindingFlags invocation attributes.

binder
Type: System.Reflection.Binder

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

target
Type: System.Object

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

args
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.

modifiers
Type: System.Reflection.ParameterModifier()

An array of System.Reflection.ParameterModifier objects.

culture
Type: System.Globalization.CultureInfo

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

namedParameters
Type: System.String()

A String array of parameters.

Return Value

Type: System.Object

The specified member.

Exception Condition
ArgumentException

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

ArgumentException

invokeAttr is not BindingFlags.CreateInstance and name is null.

ArgumentException

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

ArgumentException

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

ArgumentException

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

ArgumentException

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

MissingFieldException

The field or property cannot be found.

MissingMethodException

The method cannot be found.

SecurityException

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
Show:
© 2016 Microsoft