Class MethodCaller
- Namespace
- Rinku
- Assembly
- Rinku.dll
Generates strongly typed delegates that call a method using Rinku's parameter-shape rules for the first delegate argument. Additional delegate arguments are passed directly to selected target parameters.
public static class MethodCaller
- Inheritance
-
MethodCaller
- Inherited Members
Remarks
The generated delegate is monomorphic. Mapping is built against the delegate's first parameter type exactly. It does not choose a different mapping after creation.
Methods
CreateConstructor<TDelegate>(params CallerParameter[])
Maps the source to the only public constructor of the delegate's return type.
public static TDelegate CreateConstructor<TDelegate>(params CallerParameter[] callerParameters) where TDelegate : Delegate
Parameters
callerParametersCallerParameter[]
Returns
- TDelegate
Type Parameters
TDelegate
Create<TDelegate>(Delegate, params CallerParameter[])
Selects a static target method from a method-group delegate without invoking it.
public static TDelegate Create<TDelegate>(Delegate method, params CallerParameter[] callerParameters) where TDelegate : Delegate
Parameters
methodDelegatecallerParametersCallerParameter[]
Returns
- TDelegate
Type Parameters
TDelegate
Create<TDelegate>(Expression<Action>, params CallerParameter[])
Resolves the exact method selected by a call expression, without executing it.
public static TDelegate Create<TDelegate>(Expression<Action> method, params CallerParameter[] callerParameters) where TDelegate : Delegate
Parameters
methodExpression<Action>callerParametersCallerParameter[]
Returns
- TDelegate
Type Parameters
TDelegate
Create<TDelegate>(ConstructorInfo, params CallerParameter[])
Maps the source and explicit caller arguments to a constructor.
public static TDelegate Create<TDelegate>(ConstructorInfo constructor, params CallerParameter[] callerParameters) where TDelegate : Delegate
Parameters
constructorConstructorInfocallerParametersCallerParameter[]
Returns
- TDelegate
Type Parameters
TDelegate
Create<TDelegate>(MethodInfo, params CallerParameter[])
Generates a caller. The first delegate argument is the mapped source.
Every later argument is caller-supplied. Without callerParameters, caller-supplied arguments match target parameters by exact type.
public static TDelegate Create<TDelegate>(MethodInfo method, params CallerParameter[] callerParameters) where TDelegate : Delegate
Parameters
methodMethodInfoThe static method to call, or an instance method implemented by the mapped source itself.
callerParametersCallerParameter[]Optional positional configuration for the delegate arguments after the mapped source. Supply either none (all match by exact type), or one entry for every caller-supplied delegate argument.
Returns
- TDelegate
Type Parameters
TDelegateThe exact delegate signature to generate, including the method return type.