AddPythonBoxing() static private method

static private AddPythonBoxing ( DynamicMetaObject res ) : DynamicMetaObject
res System.Dynamic.DynamicMetaObject
return System.Dynamic.DynamicMetaObject
Beispiel #1
0
        private DynamicMetaObject /*!*/ InvokeWorker(DynamicMetaObjectBinder /*!*/ call, DynamicMetaObject /*!*/[] /*!*/ args, Expression /*!*/ codeContext)
        {
            PerfTrack.NoteEvent(PerfTrack.Categories.Binding, "Type Invoke " + Value.UnderlyingSystemType.FullName + args.Length);
            PerfTrack.NoteEvent(PerfTrack.Categories.BindingTarget, "Type Invoke");
            if (this.NeedsDeferral())
            {
                return(call.Defer(ArrayUtils.Insert(this, args)));
            }

            for (int i = 0; i < args.Length; i++)
            {
                if (args[i].NeedsDeferral())
                {
                    return(call.Defer(ArrayUtils.Insert(this, args)));
                }
            }

            DynamicMetaObject res;

            if (IsStandardDotNetType(call))
            {
                res = MakeStandardDotNetTypeCall(call, codeContext, args);
            }
            else
            {
                res = MakePythonTypeCall(call, codeContext, args);
            }

            return(BindingHelpers.AddPythonBoxing(res));
        }