コード例 #1
0
        /// <summary>
        /// Verifies that the list of games in the database are also on the
        /// server.
        /// </summary>
        /// <returns>True if games list is synced. False if not.</returns>
        public bool VerifyGameListIntegrity(out string error)
        {
            error = String.Empty;
            bool match = false;

            foreach (string gameFile in Games)
            {
                match = false;

                foreach (Game game in GameDBContext.SelectTableData())
                {
                    if (gameFile.ToLower().Contains(game.GameName.ToLower()))
                    {
                        match = true;
                        break;
                    }
                }

                if (!match)
                {
                    error += gameFile.Replace(GameServerPath.GamesFilePath, "||") + " ";
                }
            }

            return((error.Equals(String.Empty)) ? true : false);
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GetDevName();
            Panel       RowContainer = new Panel();
            Panel       Column;
            ImageButton gameImage;
            Label       gameName;

            DBGame DBGameContext = new DBGame();

            List <Game> Games = DBGameContext.SelectTableData().ToList <Game>();


            foreach (Game game in Games)
            {
                for (int row = Games.IndexOf(game); row % 4 == 0; row++)
                {
                    RowContainer          = new Panel();
                    RowContainer.CssClass = "row top5";
                }

                Column    = new Panel();
                gameImage = new ImageButton();
                gameName  = new Label();

                Column.CssClass    = "col-sm-3";
                gameImage.CssClass = "img-responsive";

                gameImage.ImageUrl      = "Images/" + game.TileImageLocation;
                gameImage.Click        += new ImageClickEventHandler(gameClick);
                gameImage.AlternateText = game.GameName;

                gameName.Text = gameImage.AlternateText;

                Column.Controls.Add(gameImage);
                Column.Controls.Add(gameName);

                RowContainer.Controls.Add(Column);

                for (int row = Games.IndexOf(game); row % 4 == 0; row++)
                {
                    GameList.Controls.Add(RowContainer);
                }
            }
        }