Esempio n. 1
0
 public static MethodFactory.MethodCall CompileMethodCall(MethodInfo method)
 {
     MethodFactory.ExpressionArgsPair methodCallExpressions = MethodFactory.GetMethodCallExpressions(method);
     return(Expression.Lambda <MethodFactory.MethodCall>(methodCallExpressions.Expression, methodCallExpressions.Parameters).Compile());
 }
Esempio n. 2
0
 public static MethodFactory.MethodCall CompileBoxedMethodCall(MethodInfo method)
 {
     MethodFactory.ExpressionArgsPair methodCallExpressions = MethodFactory.GetMethodCallExpressions(method);
     return(Expression.Lambda <MethodFactory.MethodCall>((Expression)Expression.Convert(methodCallExpressions.Expression, typeof(object)), methodCallExpressions.Parameters).Compile());
 }
Esempio n. 3
0
 public static MethodFactory.ConstructorCall CompileBoxedObjectConstructor(ConstructorInfo constructor)
 {
     MethodFactory.ExpressionArgsPair creatorExpressions = MethodFactory.GetObjectCreatorExpressions(constructor);
     return(Expression.Lambda <MethodFactory.ConstructorCall>((Expression)Expression.Convert(creatorExpressions.Expression, typeof(object)), creatorExpressions.Parameters).Compile());
 }