Пример #1
0
 // Token: 0x060015D3 RID: 5587 RVA: 0x00068080 File Offset: 0x00066280
 private static Expression[] GetArgArray(DynamicMetaObject[] args)
 {
     return(new NewArrayExpression[]
     {
         Expression.NewArrayInit(typeof(object), Class_475 <T> .GetArgs(args))
     });
 }
Пример #2
0
        // Token: 0x060015D7 RID: 5591 RVA: 0x0006816C File Offset: 0x0006636C
        private DynamicMetaObject BuildCallMethodWithResult(string methodName, DynamicMetaObjectBinder binder, Expression[] args, DynamicMetaObject fallbackResult, Class_475 <T> .Fallback fallbackInvoke)
        {
            ParameterExpression parameterExpression = Expression.Parameter(typeof(object), null);
            IList <Expression>  list = new List <Expression>();

            list.Add(Expression.Convert(base.Expression, typeof(T)));
            list.Add(Class_475 <T> .Constant(binder));
            list.AddRange(args);
            list.Add(parameterExpression);
            DynamicMetaObject dynamicMetaObject = new DynamicMetaObject(parameterExpression, BindingRestrictions.Empty);

            if (binder.ReturnType != typeof(object))
            {
                UnaryExpression expression = Expression.Convert(dynamicMetaObject.Expression, binder.ReturnType);
                dynamicMetaObject = new DynamicMetaObject(expression, dynamicMetaObject.Restrictions);
            }
            if (fallbackInvoke != null)
            {
                dynamicMetaObject = fallbackInvoke(dynamicMetaObject);
            }
            return(new DynamicMetaObject(Expression.Block(new ParameterExpression[]
            {
                parameterExpression
            }, new Expression[]
            {
                Expression.Condition(Expression.Call(Expression.Constant(this._proxy), typeof(Class_359 <T>).GetMethod(methodName), list), dynamicMetaObject.Expression, fallbackResult.Expression, binder.ReturnType)
            }), this.GetRestrictions().Merge(dynamicMetaObject.Restrictions).Merge(fallbackResult.Restrictions)));
        }
Пример #3
0
 // Token: 0x060015CB RID: 5579 RVA: 0x00067D14 File Offset: 0x00065F14
 public override DynamicMetaObject BindCreateInstance(CreateInstanceBinder binder, DynamicMetaObject[] args)
 {
     if (!this.IsOverridden("TryCreateInstance"))
     {
         return(base.BindCreateInstance(binder, args));
     }
     return(this.CallMethodWithResult("TryCreateInstance", binder, Class_475 <T> .GetArgArray(args), (DynamicMetaObject e) => binder.FallbackCreateInstance(this, args, e), null));
 }
Пример #4
0
 // Token: 0x060015D4 RID: 5588 RVA: 0x000680B4 File Offset: 0x000662B4
 private static Expression[] GetArgArray(DynamicMetaObject[] args, DynamicMetaObject value)
 {
     return(new Expression[]
     {
         Expression.NewArrayInit(typeof(object), Class_475 <T> .GetArgs(args)),
         Expression.Convert(value.Expression, typeof(object))
     });
 }
Пример #5
0
 // Token: 0x060015D1 RID: 5585 RVA: 0x00067FE0 File Offset: 0x000661E0
 public override DynamicMetaObject BindDeleteIndex(DeleteIndexBinder binder, DynamicMetaObject[] indexes)
 {
     if (!this.IsOverridden("TryDeleteIndex"))
     {
         return(base.BindDeleteIndex(binder, indexes));
     }
     return(this.CallMethodNoResult("TryDeleteIndex", binder, Class_475 <T> .GetArgArray(indexes), (DynamicMetaObject e) => binder.FallbackDeleteIndex(this, indexes, e)));
 }
Пример #6
0
 // Token: 0x060015D0 RID: 5584 RVA: 0x00067F58 File Offset: 0x00066158
 public override DynamicMetaObject BindSetIndex(SetIndexBinder binder, DynamicMetaObject[] indexes, DynamicMetaObject value)
 {
     if (!this.IsOverridden("TrySetIndex"))
     {
         return(base.BindSetIndex(binder, indexes, value));
     }
     return(this.CallMethodReturnLast("TrySetIndex", binder, Class_475 <T> .GetArgArray(indexes, value), (DynamicMetaObject e) => binder.FallbackSetIndex(this, indexes, value, e)));
 }
Пример #7
0
 // Token: 0x060015C7 RID: 5575 RVA: 0x00067B14 File Offset: 0x00065D14
 public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value)
 {
     if (!this.IsOverridden("TrySetMember"))
     {
         return(base.BindSetMember(binder, value));
     }
     return(this.CallMethodReturnLast("TrySetMember", binder, Class_475 <T> .GetArgs(new DynamicMetaObject[]
     {
         value
     }), (DynamicMetaObject e) => binder.FallbackSetMember(this, value, e)));
 }
Пример #8
0
 // Token: 0x060015CD RID: 5581 RVA: 0x00067DFC File Offset: 0x00065FFC
 public override DynamicMetaObject BindBinaryOperation(BinaryOperationBinder binder, DynamicMetaObject arg)
 {
     if (!this.IsOverridden("TryBinaryOperation"))
     {
         return(base.BindBinaryOperation(binder, arg));
     }
     return(this.CallMethodWithResult("TryBinaryOperation", binder, Class_475 <T> .GetArgs(new DynamicMetaObject[]
     {
         arg
     }), (DynamicMetaObject e) => binder.FallbackBinaryOperation(this, arg, e), null));
 }
Пример #9
0
        // Token: 0x060015CA RID: 5578 RVA: 0x00067C5C File Offset: 0x00065E5C
        public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args)
        {
            if (!this.IsOverridden("TryInvokeMember"))
            {
                return(base.BindInvokeMember(binder, args));
            }
            Class_475 <T> .Fallback fallback          = (DynamicMetaObject e) => binder.FallbackInvokeMember(this, args, e);
            DynamicMetaObject       dynamicMetaObject = this.BuildCallMethodWithResult("TryInvokeMember", binder, Class_475 <T> .GetArgArray(args), this.BuildCallMethodWithResult("TryGetMember", new Class_475 <T> .GetBinderAdapter(binder), Class_475 <T> .NoArgs, fallback(null), (DynamicMetaObject e) => binder.FallbackInvoke(e, args, null)), null);

            if (!this._dontFallbackFirst)
            {
                return(fallback(dynamicMetaObject));
            }
            return(dynamicMetaObject);
        }
Пример #10
0
        // Token: 0x060015D9 RID: 5593 RVA: 0x000683A8 File Offset: 0x000665A8
        private DynamicMetaObject CallMethodNoResult(string methodName, DynamicMetaObjectBinder binder, Expression[] args, Class_475 <T> .Fallback fallback)
        {
            DynamicMetaObject  dynamicMetaObject = fallback(null);
            IList <Expression> list = new List <Expression>();

            list.Add(Expression.Convert(base.Expression, typeof(T)));
            list.Add(Class_475 <T> .Constant(binder));
            list.AddRange(args);
            DynamicMetaObject dynamicMetaObject2 = new DynamicMetaObject(Expression.Condition(Expression.Call(Expression.Constant(this._proxy), typeof(Class_359 <T>).GetMethod(methodName), list), Expression.Empty(), dynamicMetaObject.Expression, typeof(void)), this.GetRestrictions().Merge(dynamicMetaObject.Restrictions));

            if (!this._dontFallbackFirst)
            {
                return(fallback(dynamicMetaObject2));
            }
            return(dynamicMetaObject2);
        }
Пример #11
0
        // Token: 0x060015D8 RID: 5592 RVA: 0x000682A4 File Offset: 0x000664A4
        private DynamicMetaObject CallMethodReturnLast(string methodName, DynamicMetaObjectBinder binder, Expression[] args, Class_475 <T> .Fallback fallback)
        {
            DynamicMetaObject   dynamicMetaObject   = fallback(null);
            ParameterExpression parameterExpression = Expression.Parameter(typeof(object), null);
            IList <Expression>  list = new List <Expression>();

            list.Add(Expression.Convert(base.Expression, typeof(T)));
            list.Add(Class_475 <T> .Constant(binder));
            list.AddRange(args);
            list[args.Length + 1] = Expression.Assign(parameterExpression, list[args.Length + 1]);
            DynamicMetaObject dynamicMetaObject2 = new DynamicMetaObject(Expression.Block(new ParameterExpression[]
            {
                parameterExpression
            }, new Expression[]
            {
                Expression.Condition(Expression.Call(Expression.Constant(this._proxy), typeof(Class_359 <T>).GetMethod(methodName), list), parameterExpression, dynamicMetaObject.Expression, typeof(object))
            }), this.GetRestrictions().Merge(dynamicMetaObject.Restrictions));

            if (!this._dontFallbackFirst)
            {
                return(fallback(dynamicMetaObject2));
            }
            return(dynamicMetaObject2);
        }
Пример #12
0
        // Token: 0x060015D6 RID: 5590 RVA: 0x00068134 File Offset: 0x00066334
        private DynamicMetaObject CallMethodWithResult(string methodName, DynamicMetaObjectBinder binder, Expression[] args, Class_475 <T> .Fallback fallback, Class_475 <T> .Fallback fallbackInvoke = null)
        {
            DynamicMetaObject fallbackResult    = fallback(null);
            DynamicMetaObject dynamicMetaObject = this.BuildCallMethodWithResult(methodName, binder, args, fallbackResult, fallbackInvoke);

            if (!this._dontFallbackFirst)
            {
                return(fallback(dynamicMetaObject));
            }
            return(dynamicMetaObject);
        }