예제 #1
0
        public IMethod[] GetMethods(string funcname)
        {
            List <IMethod> methods = new List <IMethod>();

            if (funcname == ".ctor")
            {
                var cons = TypeForSystem.GetConstructors();
                foreach (var c in cons)
                {
                    methods.Add(new Method_Common_System(this, c));
                }
            }
            else
            {
                var __methods = TypeForSystem.GetMethods();
                foreach (var m in __methods)
                {
                    if (m.Name == funcname)
                    {
                        methods.Add(new Method_Common_System(this, m));
                    }
                }
            }

            return(methods.ToArray());
        }
예제 #2
0
        public IMethod GetMethodT(string funcname, MethodParamList ttypes, MethodParamList types)
        {
            //这个实现还不完全
            //有个别重构下,判定比这个要复杂
            System.Reflection.MethodInfo _method = null;
            var ms = TypeForSystem.GetMethods();

            foreach (var m in ms)
            {
                if (m.Name == funcname && m.IsGenericMethodDefinition)
                {
                    var ts = m.GetGenericArguments();
                    var ps = m.GetParameters();
                    if (ts.Length == ttypes.Count && ps.Length == types.Count)
                    {
                        _method = m;
                        break;
                    }
                }
            }

            // _method = TypeForSystem.GetMethod(funcname, types.ToArraySystem());

            return(new Method_Common_System(this, _method.MakeGenericMethod(ttypes.ToArraySystem())));
        }
예제 #3
0
        public IMethod[] GetAllMethods()
        {
            List <IMethod> methods = new List <IMethod>();

            {
                var __methods = TypeForSystem.GetMethods();
                foreach (var m in __methods)
                {
                    //if (m.Name == funcname)
                    {
                        methods.Add(new Method_Common_System(this, m));
                    }
                }
            }

            return(methods.ToArray());
        }
예제 #4
0
        public virtual IMethod[] GetMethods(string funcname)
        {
            List <IMethod> methods = new List <IMethod>();

            if (funcname == ".ctor")
            {
                var cons = TypeForSystem.GetConstructors();
                {
                    var __array1       = cons;
                    var __arrayLength1 = __array1.Length;
                    for (int __i1 = 0; __i1 < __arrayLength1; ++__i1)
                    {
                        var c = __array1[__i1];
                        {
                            methods.Add(new Method_Common_System(this, c));
                        }
                    }
                }
            }
            else
            {
                var __methods = TypeForSystem.GetMethods();
                {
                    var __array2       = __methods;
                    var __arrayLength2 = __array2.Length;
                    for (int __i2 = 0; __i2 < __arrayLength2; ++__i2)
                    {
                        var m = __array2[__i2];
                        {
                            if (m.Name == funcname)
                            {
                                methods.Add(new Method_Common_System(this, m));
                            }
                        }
                    }
                }
            }

            return(methods.ToArray());
        }
예제 #5
0
        public virtual IMethod GetMethodT(string funcname, MethodParamList ttypes, MethodParamList types)
        {
            if (funcname == "CompareExchange")
            {
                return(new Method_Common_System(this, typeof(CustomMethod).GetMethod("CompareExchange")));
            }

            //这个实现还不完全
            //有个别重构下,判定比这个要复杂
            System.Reflection.MethodInfo _method = null;
            var ms = TypeForSystem.GetMethods();

            {
                var __array4       = ms;
                var __arrayLength4 = __array4.Length;
                for (int __i4 = 0; __i4 < __arrayLength4; ++__i4)
                {
                    var m = __array4[__i4];
                    {
                        if (m.Name == funcname && m.IsGenericMethodDefinition)
                        {
                            var ts = m.GetGenericArguments();
                            var ps = m.GetParameters();
                            if (ts.Length == ttypes.Count && ps.Length == types.Count)
                            {
                                _method = m;
                                break;
                            }
                        }
                    }
                }
            }
            // _method = TypeForSystem.GetMethod(funcname, types.ToArraySystem());

            return(new Method_Common_System(this, _method.MakeGenericMethod(ttypes.ToArraySystem())));
        }
예제 #6
0
        public virtual IMethod[] GetAllMethods()
        {
            List <IMethod> methods = new List <IMethod>();

            {
                var __methods = TypeForSystem.GetMethods();
                {
                    var __array3       = __methods;
                    var __arrayLength3 = __array3.Length;
                    for (int __i3 = 0; __i3 < __arrayLength3; ++__i3)
                    {
                        var m = __array3[__i3];
                        {
                            //if (m.Name == funcname)
                            {
                                methods.Add(new Method_Common_System(this, m));
                            }
                        }
                    }
                }
            }

            return(methods.ToArray());
        }