QtSilentInstall.Accessible.Descend C# (CSharp) Method

Descend() private static method

private static Descend ( ICollection c, Predicate match ) : Accessible
c ICollection
match Predicate
return Accessible
        private static Accessible Descend(ICollection<Accessible> c, Predicate<Accessible> match)
        {
            foreach (Accessible a in c)
            {
                if (match(a))
                    return a;

                if (a.hasChildren)
                {
                    Accessible r = Descend(a.Children, match);
                    if (r != null)
                        return r;
                }
            }
            return null;
        }