System.Reflection.Binder.ReorderArgumentArray Method
Restores the specified set of parameters to their original order after a call to Binder.BindToMethod(BindingFlags, MethodBase[], Object[]@, ParameterModifier[], System.Globalization.CultureInfo, String[], Object@) .

Syntax

public abstract void ReorderArgumentArray (ref object[] args, object state)

Parameters

args
An array of objects whose elements represent the parameters passed to the bound method in their original order.
state
A binder-provided opaque object that keeps track of parameter reordering. This object is the same object that was passed as the state parameter in the invocation of Binder.BindToMethod(BindingFlags, MethodBase[], Object[]@, ParameterModifier[], System.Globalization.CultureInfo, String[], Object@) that caused Binder.ReorderArgumentArray(Object[]@, object) to be called.
state
Documentation for this section has not yet been entered.

Remarks

Note: When a method call is bound to a method through reflection using Binder.BindToMethod(BindingFlags, MethodBase[], Object[]@, ParameterModifier[], System.Globalization.CultureInfo, String[], Object@) , the order, value, and type of the parameters in the original method call can be changed to match the signature of the bound method. The binder creates state as an opaque object that records the original order of the argument array. If, on return from Binder.BindToMethod(BindingFlags, MethodBase[], Object[]@, ParameterModifier[], System.Globalization.CultureInfo, String[], Object@), state is not null, the system calls Binder.ReorderArgumentArray(Object[]@, object). This allows a caller to map the argument array of a method back to the original form if the order had been altered by Binder.BindToMethod(BindingFlags, MethodBase[], Object[]@, ParameterModifier[], System.Globalization.CultureInfo, String[], Object@) . This is useful if ByRef arguments are in the argument array, because the caller can retrieve those arguments in their original order on return from this method. When arguments are passed by name (i.e., using named arguments), the binder reorders the argument array and that is what the caller sees. This method insures that the original order of the arguments is restored.

Operation
state is required to be a non-null object that tracks the original ordering of args if args is reordered by a call to Binder.BindToMethod(BindingFlags, MethodBase[], Object[]@, ParameterModifier[], System.Globalization.CultureInfo, String[], Object@) . This method is required to restore the elements of args to their original order, value, and Type

Note to Inheritors
Implement this method to insure that the parameters contained in args are returned to their original order, Type and value, after being used by a bound method.

Usage
Use this method to insure that the parameters contained in args are returned to their original order, Type and value, after being used by a bound method.

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0