AK.F1.Timing.AssertionExtensions.GetPublicPropertyGetMethods C# (CSharp) Method

GetPublicPropertyGetMethods() private static method

private static GetPublicPropertyGetMethods ( Type type ) : IEnumerable
type System.Type
return IEnumerable
        private static IEnumerable<MethodInfo> GetPublicPropertyGetMethods(Type type)
        {
            const BindingFlags flags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly;

            do
            {
                foreach(var property in type.GetProperties(flags))
                {
                    if(property.GetGetMethod().GetParameters().Length == 0)
                    {
                        yield return property.GetGetMethod();
                    }
                }
            } while(!(type = type.BaseType).Equals(typeof(object)));
        }