Export (0) Print
Expand All

AccessibleObject.IReflect.InvokeMember Method

This API supports the .NET Framework 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 abstract InvokeMember : 
        name:string * 
        invokeAttr:BindingFlags * 
        binder:Binder * 
        target:Object * 
        args:Object[] * 
        modifiers:ParameterModifier[] * 
        culture:CultureInfo * 
        namedParameters:string[] -> Object  
private override InvokeMember : 
        name:string * 
        invokeAttr:BindingFlags * 
        binder:Binder * 
        target:Object * 
        args:Object[] * 
        modifiers:ParameterModifier[] * 
        culture:CultureInfo * 
        namedParameters:string[] -> Object

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.

Implements

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

ExceptionCondition
ArgumentException

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

ArgumentException

invokeAttr is not BindingFlags.CreateInstance and name is a null reference (Nothing in Visual Basic).

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

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft