Delegate.DynamicInvoke(Object[]) Delegate.DynamicInvoke(Object[]) Delegate.DynamicInvoke(Object[]) Method

Definition

Dynamically invokes (late-bound) the method represented by the current delegate.

public:
 System::Object ^ DynamicInvoke(... cli::array <System::Object ^> ^ args);
public object DynamicInvoke (params object[] args);
Public Function DynamicInvoke (ParamArray args As Object()) As Object
Parameters
args
Object[]

An array of objects that are the arguments to pass to the method represented by the current delegate.

-or-

null, if the method represented by the current delegate does not require arguments.

Returns

The object returned by the method represented by the delegate.

Exceptions

The caller does not have access to the method represented by the delegate (for example, if the method is private).

-or-

The number, order, or type of parameters listed in args is invalid.

The method represented by the delegate is invoked on an object or a class that does not support it.

The method represented by the delegate is an instance method and the target object is null.

-or-

One of the encapsulated methods throws an exception.

Remarks

This method calls the DynamicInvokeImpl method.

Security

ReflectionPermission
when invoked late-bound through mechanisms such as InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]). Associated enumeration: MemberAccess

Applies to

See Also