예제 #1
0
 private void CustomItem_MouseClick(object sender, EventArgs e)
 {
     if (sender is Button)
     {
         Button suspect = (Button)sender;
         if (suspect.Name.Equals(this.GameBuyButton.Name))
         {
             if (Owned)
             {
                 var SelectGame = LoggedUser.gameLibrary.Where(a => a.GameID.Equals(RegisteredGame.GameID)).FirstOrDefault();
                 SelectGame.PlayCount++;
                 //Console.WriteLine("GamePage. Player Played Game: " + SelectGame.PlayCount);
                 FAM.UpdateUserGames(LoggedUser);
                 this.PlayCountLabel.Text = "Play Count: " + SelectGame.PlayCount;
             }
             else
             {
                 Console.WriteLine("GamePage. Player does not own game.");
                 if (!GameCart.Contains(RegisteredGame))
                 {
                     Console.WriteLine("GamePage. Game is not in Cart. Adding to Cart");
                     GameCart.Add(RegisteredGame);
                 }
             }
         }
     }
 }