예제 #1
0
        internal static object MemberTrackerToPython(CodeContext /*!*/ context, object ret)
        {
            if (ret is MemberTracker res)
            {
                context.ShowCls = true;
                object realRes = res;

                switch (res.MemberType)
                {
                case TrackerTypes.Type: realRes = DynamicHelpers.GetPythonTypeFromType(((TypeTracker)res).Type); break;

                case TrackerTypes.Field: realRes = PythonTypeOps.GetReflectedField(((FieldTracker)res).Field); break;

                case TrackerTypes.Event: realRes = PythonTypeOps.GetReflectedEvent((EventTracker)res); break;

                case TrackerTypes.Method:
                    MethodTracker mt = res as MethodTracker;
                    realRes = PythonTypeOps.GetBuiltinFunction(mt.DeclaringType, mt.Name, new MemberInfo[] { mt.Method });
                    break;
                }

                ret = realRes;
            }
            return(ret);
        }