ActivEarth.Groups.WallDisplay.PopulateMessageTable C# (CSharp) Method

PopulateMessageTable() public method

Formats the table of Messages based on the given list of Messages and colors.
public PopulateMessageTable ( List messages, Color backColors, Color textColors ) : void
messages 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
return void
        public void PopulateMessageTable(List<ActivEarth.Objects.Groups.Message> messages, Color[] backColors, Color[] textColors)
        {
            int colorIndex = 0;
            int textIndex = 0;

            messages.Reverse();
            foreach (ActivEarth.Objects.Groups.Message message in messages)
            {
                _wall.Rows.Add(MakeRowForTable(message, backColors[colorIndex], textColors[textIndex]));

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

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