Ejemplo n.º 1
0
 private void HandlerBtnEdit_Click(object sender, RoutedEventArgs e)
 {
     var playerEdit = new PlayerEdit();
     playerEdit.SetPlayerDetails(player);
     playerView.Hide();
     ModalDisplay.ShowModal(playerEdit, playerView);
     if (playerEdit.GetButtonAction().Equals(ButtonAction.DONE))
     {
         player = playerEdit.GetPlayer();
         player.SetP_ID(playerID);
         fileHandler.UpdatePlayer(player);
         playerView.SetPlayerDetails(player);
     }
     playerView.Show();
 }
Ejemplo n.º 2
0
 private void ShowEditDialog(int playerID)
 {
     var playerEdit = new PlayerEdit();
     playerEdit.SetPlayerDetails(players[playerID]);
     ModalDisplay.ShowModal(playerEdit, modalSelect);
     if (playerEdit.GetButtonAction().Equals(ButtonAction.DONE))
     {
         players[playerID] = playerEdit.GetPlayer();
         players[playerID].SetP_ID(playerID);
         fileHandler.UpdatePlayer(players[playerID]);
      /*           if (!playersIDSelected.Contains(playerID))
         {
             playersIDSelected.Add(playerID);
         }*/
         modalSelect.DisplayPlayers(players);
     }
 }
Ejemplo n.º 3
0
 private void HandleContextMenuEdit_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     //Change this otherwise cancel is useless
     var editPlayer = new PlayerEdit();
     var playerID = modalTeam.GetSelectedPlayerID();
     editPlayer.SetPlayerDetails(fileHandler.GetPlayer(playerID).Clone());
     ModalDisplay.ShowModal(editPlayer, modalTeam.Owner);
     if (editPlayer.GetButtonAction().Equals(ButtonAction.DONE))
     {
         var player = editPlayer.GetPlayer();
         player.SetP_ID(playerID);
         fileHandler.UpdatePlayer(player);
         modalTeam.ShowPlayers(GetTeamPlayers());
     }
 }