System.Dynamic.InvokeMemberBinder.FallbackInvokeMember C# (CSharp) Method

FallbackInvokeMember() public abstract method

When overridden in the derived class, performs the binding of the dynamic invoke member operation if the target dynamic object cannot bind.
public abstract FallbackInvokeMember ( DynamicMetaObject target, DynamicMetaObject args, DynamicMetaObject errorSuggestion ) : DynamicMetaObject
target DynamicMetaObject The target of the dynamic invoke member operation.
args DynamicMetaObject The arguments of the dynamic invoke member operation.
errorSuggestion DynamicMetaObject The binding result to use if binding fails, or null.
return DynamicMetaObject
        public abstract DynamicMetaObject FallbackInvokeMember(DynamicMetaObject target, DynamicMetaObject[] args, DynamicMetaObject errorSuggestion);

Same methods

InvokeMemberBinder::FallbackInvokeMember ( DynamicMetaObject target, DynamicMetaObject args ) : DynamicMetaObject

Usage Example

Esempio n. 1
0
            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));
            }
All Usage Examples Of System.Dynamic.InvokeMemberBinder::FallbackInvokeMember