예제 #1
0
        private void addSavedGame(SavedGameInfo gameData)
        {
            var itemView = new SavedGameItemView();

            itemView.Data = gameData;

            gameList.Controls.Add(itemView);
        }
예제 #2
0
        private void gameList_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.loadButton.Enabled &= !(this.gameList.SelectedItem is Label);

            if (this.gameList.SelectedItem == null || !(this.gameList.SelectedItem is SavedGameItemView) || this.gameList.SelectedItem == this.selectedGame)
            {
                return;
            }

            if (this.selectedGame != null)
            {
                this.selectedGame.Deselect();
            }

            this.selectedGame = this.gameList.SelectedItem as SavedGameItemView;
            this.selectedGame.OnSelect();

            this.loadButton.Enabled = (this.selectedGame.Data != null);
        }