using System;
using System.Collections.ObjectModel;
using System.Reflection;
+using System.Reflection.Emit;
namespace System.Linq.Expressions {
public sealed class MethodCallExpression : Expression {
- Expression @object;
+ Expression obj;
MethodInfo method;
ReadOnlyCollection<Expression> arguments;
public Expression Object {
- get { return @object; }
+ get { return obj; }
}
public MethodInfo Method {
get { return arguments; }
}
- internal MethodCallExpression (Expression @object, MethodInfo method, ReadOnlyCollection<Expression> arguments)
+ internal MethodCallExpression (MethodInfo method, ReadOnlyCollection<Expression> arguments)
: base (ExpressionType.Call, method.ReturnType)
{
- this.@object = @object;
+ this.method = method;
+ this.arguments = arguments;
+ }
+
+ internal MethodCallExpression (Expression obj, MethodInfo method, ReadOnlyCollection<Expression> arguments)
+ : base (ExpressionType.Call, method.ReturnType)
+ {
+ this.obj = obj;
this.method = method;
this.arguments = arguments;
}
internal override void Emit (EmitContext ec)
{
- throw new NotImplementedException ();
+ ec.EmitCall (obj, arguments, method);
}
}
}