ActivEarth.Competition.Contests.TeamDisplayTable.PopulateTeamTable C# (CSharp) Метод

PopulateTeamTable() публичный Метод

Populates the Team table with the team names that are given.
public PopulateTeamTable ( List teams, Color backColors, Color textColors ) : void
teams List The teams to display.
backColors Color The backcolors to use for rows.
textColors Color The text colors used for rows.
Результат void
        public void PopulateTeamTable(List<ContestTeam> teams, Color[] backColors, Color[] textColors)
        {
            int colorIndex = 0;
            int textIndex = 0;
            int idIndex = 0;

            foreach (ContestTeam team in teams)
            {
                TeamTable.Rows.Add(MakeRowForTable(team.Name, backColors[colorIndex], textColors[textIndex]));

                colorIndex++;
                if (colorIndex == backColors.Length)
                {
                    colorIndex = 0;
                }

                textIndex++;
                if (textIndex == textColors.Length)
                {
                    textIndex = 0;
                }

                idIndex++;
            }
        }