ActivEarth.Groups.GroupsDisplayTable.PopulateGroupsTable C# (CSharp) Метод

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

Formats the table of Groups based on the given list of Groups and colors.
public PopulateGroupsTable ( List groups, Color backColors, Color textColors ) : void
groups List The list of messages to display in the table
backColors Color The list of alternating background colors to display in the table
textColors Color The list of alternating text colors to display in the table
Результат void
        public void PopulateGroupsTable(List<ActivEarth.Objects.Groups.Group> groups, Color[] backColors, Color[] textColors)
        {
            this.userDetails = (User)Session["userDetails"];

            int colorIndex = 0;
            int textIndex = 0;

            foreach (ActivEarth.Objects.Groups.Group group in groups)
            {
                _groupsTable.Rows.Add(MakeRowForTable(group, backColors[colorIndex], textColors[textIndex]));

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

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