Example #1
0
        public void DrawGameListPanelControls(int pageNumber)
        {
            gamesListPanel.Controls.Clear();

            for (int i = gamesPerPage * pageNumber; i < (gamesPerPage * pageNumber) + gamesPerPage; i++)
            {
                if (i < gamesToBeDisplayed.Count)
                {
                    gamesListPanel.Controls.Add(ControlsGenerator.GenerateGamePanel(gamesToBeDisplayed[i]));
                }
            }

            if (pageNumber > 0)
            {
                Button back = ControlsGenerator.GenerateBtn("<< BACK");
                back.Click += Nav_Click;
                back.Tag    = pageNumber - 1;
                gamesListPanel.Controls.Add(back);
            }

            if (gamesToBeDisplayed.Count > gamesPerPage * (pageNumber + 1))
            {
                Button next = ControlsGenerator.GenerateBtn("NEXT >>");
                next.Click += Nav_Click;
                next.Tag    = pageNumber + 1;
                gamesListPanel.Controls.Add(next);
            }
        }
Example #2
0
 public void PopulateGenreList(GenreContainer genre)
 {
     foreach (Games game in genre.GetContainer())
     {
         gamesListPanel.Controls.Add(ControlsGenerator.GenerateGamePanel(game));
     }
 }