Example #1
0
        protected static ZMethodInfo[] GetZMethods(Type markType, Type sharpType, bool isStatic)
        {
            List <ZMethodInfo> list = new List <ZMethodInfo>();

            MethodInfo[] methods = markType.GetMethods();
            foreach (MethodInfo method in methods)
            {
                if (ReflectionUtil.IsDeclare(markType, method))
                {
                    if (AttributeUtil.HasAttribute <ZCodeAttribute>(method))
                    {
                        MethodInfo newMethod = sharpType.GetMethod(method.Name);
                        if (newMethod == null)
                        {
                            throw new ZyyRTException();
                        }
                        else
                        {
                            if (isStatic == newMethod.IsStatic) //if ((isStatic && method.IsStatic) || (!isStatic && !method.IsStatic))
                            {
                                ZMethodInfo zproperty = new ZMethodInfo(method, newMethod);
                                list.Add(zproperty);
                            }
                        }
                    }
                }
            }
            return(list.ToArray());
        }
Example #2
0
        public ZMethodInfo SearchZMethod(ZCallDesc zpdesc)
        {
            ZClassType temp = this;

            while (temp != null)
            {
                ZMethodInfo zmethod = temp.FindDeclaredZMethod(zpdesc);
                if (zmethod != null)
                {
                    return(zmethod);
                }
                else
                {
                    temp = temp.BaseZType;
                }
            }
            return(null);
        }