コード例 #1
0
        public static ZLPropertyInfo[] GetZPropertys(Type markType, Type sharpType, bool isStatic, ZLClassInfo zclass)
        {
            List <ZLPropertyInfo> list = new List <ZLPropertyInfo>();

            PropertyInfo[] propertyArray = markType.GetProperties();
            foreach (var property in propertyArray)
            {
                if (ReflectionUtil.IsDeclare(markType, property))
                {
                    if (AttributeUtil.HasAttribute <ZCodeAttribute>(property))
                    {
                        PropertyInfo newPropertyInfo = sharpType.GetProperty(property.Name);
                        if (newPropertyInfo == null)
                        {
                            throw new ZyyRTException();
                        }
                        else
                        {
                            if (isStatic == ReflectionUtil.IsStatic(newPropertyInfo))
                            {
                                ZLPropertyInfo zproperty = new ZLPropertyInfo(zclass, property, newPropertyInfo);
                                list.Add(zproperty);
                            }
                        }
                    }
                }
            }
            return(list.ToArray());
        }
コード例 #2
0
ファイル: ZLClassInfo.cs プロジェクト: pyzh/ZLanguage3
        public ZLPropertyInfo SearchProperty(string zname)
        {
            ZLClassInfo temp = this;

            while (temp != null)
            {
                ZLPropertyInfo zp = temp.SearchDeclaredZProperty(zname);
                if (zp != null)
                {
                    return(zp);
                }
                else
                {
                    temp = temp.BaseZClass;
                }
            }
            return(null);
        }