예제 #1
0
        // Token: 0x06000E42 RID: 3650 RVA: 0x00052758 File Offset: 0x00050958
        public static IEnumerable <PropertyInfo> GetProperties(Type targetType, BindingFlags bindingAttr)
        {
            ValidationUtils.ArgumentNotNull(targetType, "targetType");
            List <PropertyInfo> list = new List <PropertyInfo>(targetType.GetProperties(bindingAttr));

            if (targetType.IsInterface())
            {
                foreach (Type type in targetType.GetInterfaces())
                {
                    list.AddRange(type.GetProperties(bindingAttr));
                }
            }
            ReflectionUtils.GetChildPrivateProperties(list, targetType, bindingAttr);
            for (int j = 0; j < list.Count; j++)
            {
                PropertyInfo propertyInfo = list[j];
                if (propertyInfo.DeclaringType != targetType)
                {
                    PropertyInfo value = (PropertyInfo)ReflectionUtils.GetMemberInfoFromType(propertyInfo.DeclaringType, propertyInfo);
                    list[j] = value;
                }
            }
            return(list);
        }