private void UpdateList() { ListOfTeams.Items.Clear(); List <Team> Ts; if (FlyModelsList.SelectedIndex == TimerSettings.Competition.Teams.TeamClumps.Count) { Ts = TimerSettings.Competition.Teams.GetTeams(); } else if (FlyModelsList.SelectedIndex < TimerSettings.Competition.Teams.TeamClumps.Count) { Ts = TimerSettings.Competition.Teams.TeamClumps[FlyModelsList.SelectedIndex].Teams(); } else { Ts = TimerSettings.Competition.Teams.AllTeams.FindAll(delegate(Team T) { return(T.CM.TeamSets.Find(delegate(TeamSet tset) { return tset.ShareSamePerson(T); }) == null); }); } List <Team> TsFiltered; if (searchBox.Text != "") { TsFiltered = Ts.FindAll(delegate(Team T) { return(T.Pilot.Name.Contains(searchBox.Text) | T.Mechanic.Name.Contains(searchBox.Text)); }); } else { TsFiltered = Ts; } ListOfTeams.Items.AddRange(TsFiltered.ToArray()); }