Пример #1
0
            public override DynamicMetaObject/*!*/ Bind(DynamicMetaObject/*!*/ target, DynamicMetaObject/*!*/[]/*!*/ args) {
                Debug.Assert(args.Length > 1);

                var exprs = new AstExpressions();
                exprs.Add(AstUtils.LightDynamic(_getMember, typeof(object), target.Expression));
                exprs.Add(args.ToExpressions());

                return new DynamicMetaObject(AstUtils.LightDynamic(_setIndex, typeof(object), exprs), BindingRestrictions.Empty);
            }
Пример #2
0
            public override DynamicMetaObject/*!*/ FallbackInvoke(DynamicMetaObject/*!*/ target, DynamicMetaObject/*!*/[]/*!*/ args,
                DynamicMetaObject errorSuggestion) {

                AstExpressions exprs = new AstExpressions();
                exprs.Add(target.Expression);
                exprs.Add(args.ToExpressions());

                return new DynamicMetaObject(
                    AstUtils.LightDynamic(_context.MetaBinderFactory.InteropReturn(CallInfo), typeof(object), exprs),
                    target.Restrictions.Merge(BindingRestrictions.Combine(args))
                );
            }