AccessibleObject::IReflect::InvokeMember Method (String^, BindingFlags, Binder^, Object^, array<Object^>^, array<ParameterModifier>^, CultureInfo^, array<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.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
private: virtual Object^ InvokeMember( String^ name, BindingFlags invokeAttr, Binder^ binder, Object^ target, array<Object^>^ args, array<ParameterModifier>^ modifiers, CultureInfo^ culture, array<String^>^ namedParameters ) sealed = 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:
array<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:
array<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:
array<System::String^>^
A String array of parameters.
| 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.
Available since 1.1