예제 #1
0
        private void OnUserConnected(string nick)
        {
            ConnectedPlayers.Add(new ListItem {
                Nick = nick
            });

            AvailablePlayers.Add(nick);
        }
예제 #2
0
        private void OnPlayerFinished(string nick)
        {
            if (ConnectedPlayers.Select(item => item.Nick).Contains(nick))
            {
                ConnectedPlayers.First(item => item.Nick == nick).IsPlaying = false;
            }

            AvailablePlayers.Add(nick);
        }
예제 #3
0
        public void RemoveSelectedMember()
        {
            if (SelectedMember != null)
            {
                AvailablePlayers.Add(SelectedMember);
                TeamMembers.Remove(SelectedMember);
            }

            ValidateAllData();
        }
예제 #4
0
 public void RemovePlayer(object parameter)
 {
     playerEngine.ActivePlayers.Remove(SelectedPlayer);
     AvailablePlayers.Add(SelectedPlayer);
     if (SelectedPlayer != null)
     {
         SelectedPlayers.Remove(SelectedPlayer);
         SelectedPlayer = null;
     }
     SelectedPlayer = null;
 }
예제 #5
0
        public void AddPlayerCommandHandler(object args)
        {
            AvailablePlayers.Add(
                new Player
            {
                FullName     = NewPlayerName,
                DCINumber    = NewPlayerDCINumber,
                EmailAddress = NewPlayerEmailAddress,
                PhoneNumber  = NewPlayerPhoneNumber
            });

            AddPlayerCommand.RaiseCanExecuteChanged();
            OnPropertyChanged("AvailablePlayers");
            OnPropertyChanged("FilteredAvailablePlayers");
        }
예제 #6
0
        private void AddNewPlayer(object parameter)
        {
            Player player;

            player = new Player
            {
                Firstname = _Firstname,
                Lastname  = _Lastname,
                Nickname  = _Nickname
            };
            if (CheckForNicknameAvailability())
            {
                dbOps.RegisterPlayer(player);
                AvailablePlayers.Add(player);
                GetFilteredPlayers();
                _Firstname = null;
                _Lastname  = null;
                _Nickname  = null;
            }
            else
            {
                MessageBox.Show("Användarnamnet är upptaget. Välj ett annat!");
            }
        }