Ejemplo n.º 1
0
        public static IEnumerable <Control> Flatten(this ControlCollection controls)
        {
            List <Control> list = new List <Control>();

            controls.Traverse(c => list.Add(c));
            return(list);
        }
Ejemplo n.º 2
0
        public static IEnumerable <Control> Flatten(
            this ControlCollection controls,
            Func <Control, bool> predicate)
        {
            List <Control> list = new List <Control>();

            controls.Traverse(c => { if (predicate(c))
                                     {
                                         list.Add(c);
                                     }
                              });
            return(list);
        }