Esempio n. 1
0
 /// <summary>
 /// Removes the passed game from the list of games, and saves the newly updated list to the file.
 /// If the game passed is the same game as the SelectedGame, SelectedGame will be set to null.
 /// </summary>
 /// <param name="removeGame">The game to be removed.</param>
 public void RemoveGame(Game removeGame)
 {
     if (SelectedGame == removeGame)
     {
         SelectedGame = null;
     }
     StoreGameCollection.Remove(removeGame);
     FileHandler.WriteFile(Constants.GameFileListName, StoreGameCollection);
 }
Esempio n. 2
0
 /// <summary>
 /// Removes the passed games from the list of games, and saves the newly updated list to the file.
 /// If one of the games passed is the same game as the SelectedGame, SelectedGame will be set to null.
 /// </summary>
 /// <param name="removeGames">The list of games to be removed.</param>
 public void RemoveGame(List <Game> removeGames)
 {
     foreach (Game game in removeGames)
     {
         if (SelectedGame == game)
         {
             SelectedGame = null;
         }
         StoreGameCollection.Remove(game);
     }
     FileHandler.WriteFile(Constants.GameFileListName, StoreGameCollection);
 }