Пример #1
0
        private void selectPlayer(Player player)
        {
            _selectedPlayer = player;

            if (_selectedPlayer != null)
            {
                SelectedPlayerEditVM = new PlayerEditViewModel(_selectedPlayer);
                SelectedPlayerEditVM.SetStatusBarMsg += new SetStatusBarMsgEventHandler(OnSetStatusBarMsg);
                SelectedPlayerEditVM.DraftPlayerEvent += new PlayerEditViewModel.DraftPlayerEventHandler(draftPlayer);
                SelectedPlayerEditVM.RefreshPlayersEvent += new PlayerEditViewModel.RefreshPlayersEventHandler(refreshPlayers);
            }
        }
Пример #2
0
        private void addPlayer()
        {
            SelectedPlayer = null;

            SelectedPlayerEditVM = new PlayerEditViewModel(null);
            SelectedPlayerEditVM.SetStatusBarMsg += new SetStatusBarMsgEventHandler(OnSetStatusBarMsg);
            SelectedPlayerEditVM.DraftPlayerEvent += new PlayerEditViewModel.DraftPlayerEventHandler(draftPlayer);
            SelectedPlayerEditVM.RefreshPlayersEvent += new PlayerEditViewModel.RefreshPlayersEventHandler(refreshPlayers);

            //if (DbConnection.AddPlayer() == true)
            //{
            //    OnSetStatusBarMsg("New player added.", "Green");
            //    Global.GlobalCollections.Instance.LoadPlayers();
            //}
            //else
            //{
            //    OnSetStatusBarMsg("Error adding new player.", "Red");
            //}
        }