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

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

public StaticValueGet ( CLS_Content environment, string valuename ) : CLS_Content.Value
environment CLS_Content
valuename string
Результат CLS_Content.Value
        public virtual CLS_Content.Value StaticValueGet(CLS_Content environment, string valuename)
        {
            var v = MemberValueGet(environment, null, valuename);
            if (v == null)
            {
                if (type.BaseType != null)
                {
                    return environment.environment.GetType(type.BaseType).function.StaticValueGet(environment, valuename);
                }
                else
                {
                    throw new NotImplementedException();
                }
            }
            else
            {
                return v;
            }

            //var targetf = type.GetField(valuename);
            //if (targetf != null)
            //{
            //    CLS_Content.Value v = new CLS_Content.Value();
            //    v.value = targetf.GetValue(null);
            //    v.type = targetf.FieldType;
            //    return v;
            //}
            //else
            //{
            //    var methodf = type.GetMethod("get_" + valuename);
            //    if (methodf != null)
            //    {
            //        CLS_Content.Value v = new CLS_Content.Value();
            //        v.value = methodf.Invoke(null, null);
            //        v.type = methodf.ReturnType;
            //        return v;
            //    }
            //    //var targetf = type.GetField(valuename);
            //    //if (targetf != null)
            //    //{
            //    //    CLS_Content.Value v = new CLS_Content.Value();
            //    //    v.value = targetf.GetValue(null);
            //    //    v.type = targetf.FieldType;
            //    //    return v;
            //    //}
            //    else
            //    {
            //        var targete = type.GetEvent(valuename);
            //        if (targete != null)
            //        {
            //            CLS_Content.Value v = new CLS_Content.Value();

            //            v.value = new DeleEvent(null, targete);
            //            v.type = targete.EventHandlerType;
            //            return v;
            //        }
            //    }
            //}
            //if (type.BaseType != null)
            //{
            //    return environment.environment.GetType(type.BaseType).function.StaticValueGet(environment, valuename);
            //}


            //throw new NotImplementedException();
        }