FastMember.TypeAccessor.IsFullyPublic C# (CSharp) Method

IsFullyPublic() private static method

private static IsFullyPublic ( Type type, PropertyInfo props, bool allowNonPublicAccessors ) : bool
type System.Type
props System.Reflection.PropertyInfo
allowNonPublicAccessors bool
return bool
        private static bool IsFullyPublic(Type type, PropertyInfo[] props, bool allowNonPublicAccessors)
        {
            while (_IsNestedPublic(type)) type = type.DeclaringType;
            if (!_IsPublic(type)) return false;

            if (allowNonPublicAccessors)
            {
                for (int i = 0; i < props.Length; i++)
                {
                    if (props[i].GetGetMethod(true) != null && props[i].GetGetMethod(false) == null) return false; // non-public getter
                    if (props[i].GetSetMethod(true) != null && props[i].GetSetMethod(false) == null) return false; // non-public setter
                }
            }

            return true;
        }
        static TypeAccessor CreateNew(Type type, bool allowNonPublicAccessors)