CSLE.RegHelper_TypeFunction.MemberCallCache C# (CSharp) Метод

MemberCallCache() публичный Метод

public MemberCallCache ( CLS_Content content, object object_this, IList _params, MethodCache cache ) : CLS_Content.Value
content CLS_Content
object_this object
_params IList
cache MethodCache
Результат CLS_Content.Value
        public virtual CLS_Content.Value MemberCallCache(CLS_Content content, object object_this, IList<CLS_Content.Value> _params, MethodCache cache)
        {
            List<Type> types = new List<Type>();
            List<object> _oparams = new List<object>();
            foreach (var p in _params)
            {
                {
                    _oparams.Add(p.value);
                }
                if ((SType)p.type != null)
                {
                    types.Add(typeof(object));
                }
                else
                {
                    types.Add(p.type);
                }
            }

            var targetop = cache.info;
            CLS_Content.Value v = new CLS_Content.Value();
            if (cache.slow)
            {
                var pp = targetop.GetParameters();
                for (int i = 0; i < pp.Length; i++)
                {
                    if (i >= _params.Count)
                    {
                        _oparams.Add(pp[i].DefaultValue);
                    }
                    else
                    {
                        if (pp[i].ParameterType != (Type)_params[i].type)
                        {
                            _oparams[i] = content.environment.GetType(_params[i].type).ConvertTo(content, _oparams[i], pp[i].ParameterType);
                        }
                    }
                }
            }
            v.value = targetop.Invoke(object_this, _oparams.ToArray());
            v.type = targetop.ReturnType;
            return v;
        }