ActivEarth.Account.WallDisplay.PopulateMessageTable C# (CSharp) 메소드

PopulateMessageTable() 공개 메소드

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
리턴 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();
            _wall.Width = new Unit(80, UnitType.Percentage);
        }