Exemplo n.º 1
0
        IEnumerable <DepartmentViewModel> FindMatches(string searchText, DepartmentViewModel person)
        {
            if (person.NameContainsText(searchText))
            {
                yield return(person);
            }

            foreach (DepartmentViewModel child in person.Children)
            {
                foreach (DepartmentViewModel match in this.FindMatches(searchText, child))
                {
                    yield return(match);
                }
            }
        }
Exemplo n.º 2
0
        IEnumerable<DepartmentViewModel> FindMatches(string searchText, DepartmentViewModel person)
        {
            if (person.NameContainsText(searchText))
                yield return person;

            foreach (DepartmentViewModel child in person.Children)
                foreach (DepartmentViewModel match in this.FindMatches(searchText, child))
                    yield return match;
        }