public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args)
{
// Generate a tree like:
//
// {
// object result;
// TryInvokeMember(payload, out result)
// ? result
// : TryGetMember(payload, out result)
// ? FallbackInvoke(result)
// : fallbackResult
// }
//
// Then it calls FallbackInvokeMember with this tree as the
// "error", giving the language the option of using this
// tree or doing .NET binding.
//
DynamicMetaObject call = BuildCallMethodWithResult(
nameof(DynamicObject.TryInvokeMember),
binder,
GetExpressions(args),
BuildCallMethodWithResult <GetMemberBinder>(
nameof(DynamicObject.TryGetMember),
new GetBinderAdapter(binder),
s_noArgs,
binder.FallbackInvokeMember(this, args, null),
(MetaDynamic @this, GetMemberBinder ignored, DynamicMetaObject e) => binder.FallbackInvoke(e, args, null)
),
null
);
return(binder.FallbackInvokeMember(this, args, call));
}