ActivEarth.Competition.Contests.ContestDisplayTable.PopulateContestTable C# (CSharp) Метод

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

Adds a list of contests to the table.
public PopulateContestTable ( List contests, List ids, Color backColors, Color textColors ) : void
contests List The contest names to display.
ids List The contest ids of the contests.
backColors Color The colors used for the background of rows in the table.
textColors Color The color of the text used in the table.
Результат void
        public void PopulateContestTable(List<string> contests, List<int> ids, Color[] backColors, Color[] textColors)
        {
            int colorIndex = 0;
            int textIndex = 0;
            int idIndex = 0;

            foreach (string contest in contests)
            {
                _contestTable.Rows.Add(MakeRowForTable(contest, ids[idIndex], backColors[colorIndex], textColors[textIndex]));

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

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

                idIndex++;
            }
        }