Esempio n. 1
0
        private void AddPlayer()
        {
            var playerEditorForm = new FrmPlayerEditor();

            if (playerEditorForm.ShowDialog() == DialogResult.OK)
            {
                var newPlayer = playerEditorForm.Player;
                PlayerboardLogic.AddPlayer(this.playerboard, newPlayer);
                PlayerboardLogic.Save(this.playerboard);
                this.PopulateListview();
            }
        }
Esempio n. 2
0
        private void EditPlayer()
        {
            if (this.lvwPlayers.SelectedItems.Count == 1)
            {
                var oldPlayer = this.lvwPlayers.SelectedItems[0].Text;
                var editor    = new FrmPlayerEditor();
                editor.SetData(oldPlayer);

                if (editor.ShowDialog() == DialogResult.OK)
                {
                    var newPlayer = editor.Player;
                    PlayerboardLogic.UpdatePlayer(this.playerboard, oldPlayer, newPlayer);
                    PlayerboardLogic.Save(this.playerboard);
                    this.PopulateListview();
                }
            }
        }