Esempio n. 1
0
 private static void AddChilds <T>(IVisitCorrection <T> q, Func <T, IEnumerable <T> > childs, T control)
 {
     foreach (var child in childs(control))
     {
         q.Add(child);
     }
 }
Esempio n. 2
0
        private static IEnumerable <T> DescendansQueue <T>(IVisitCorrection <T> q, Func <T, bool> selector, Func <T, IEnumerable <T> > childs)
        {
            while (q.Count != 0)
            {
                var control = q.Pop();
                if (selector(control))
                {
                    yield return(control);
                }

                AddChilds(q, childs, control);
            }
        }