예제 #1
0
        private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            PlayerboardLogic.Save(this.playerboard);

            this.appSettings.WindowSize = this.Size;
            AppSettingsLogic.Save(this.appSettings);
        }
예제 #2
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();
            }
        }
예제 #3
0
 private void DeletePlayers()
 {
     if (this.lvwPlayers.SelectedItems.Count > 0)
     {
         if (MessageBox.Show(this.lvwPlayers.SelectedItems.Count + " Spieler löschen?", "Spielereditor", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
         {
             var player = this.lvwPlayers.SelectedItems[0].Text;
             PlayerboardLogic.RemovePlayer(this.playerboard, player);
             PlayerboardLogic.Save(this.playerboard);
             this.PopulateListview();
         }
     }
 }
예제 #4
0
        private void MnuFileSetCourtCount_Click(object sender, EventArgs e)
        {
            var courtCountForm = new FrmCourtCount();

            courtCountForm.SetData(this.playerboard.Courts.Count);
            if (courtCountForm.ShowDialog() == DialogResult.OK)
            {
                PlayerboardLogic.SetCourtCount(this.playerboard, courtCountForm.CourtCount);
                this.displayForm.InitializeDisplayControls();
                this.InitializeSettingControls();

                PlayerboardLogic.Save(this.playerboard);
            }
        }
예제 #5
0
        private void MnuSetCourtCount_Click(object sender, RoutedEventArgs e)
        {
            var frmCourtCount = new FrmCourtCount();

            frmCourtCount.SetData(this.playerboard.Courts.Count);
            if (frmCourtCount.ShowDialog() == true)
            {
                PlayerboardLogic.SetCourtCount(this.playerboard, frmCourtCount.CourtCount);
                this.displayForm.InitializeDisplayControls();
                this.InitializeSettingControls();

                PlayerboardLogic.Save(this.playerboard);
            }
        }
예제 #6
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();
                }
            }
        }
예제 #7
0
        private void MnuFileEditPlayers_Click(object sender, EventArgs e)
        {
            var playerForm = new FrmPlayer(this.playerboard);

            if (playerForm.ShowDialog() == DialogResult.OK)
            {
                var players = this.playerboard.Players.ToArray();
                foreach (var settingsControl in this.pnlSettingsControls.Controls)
                {
                    if (settingsControl is CourtSettingsControl control)
                    {
                        control.SetAutocompletionData(players);
                    }
                }

                PlayerboardLogic.Save(this.playerboard);
            }
        }
예제 #8
0
 private void SettingsControl_OnApplyRequested(object sender, CourtEventArgs courtEventArgs)
 {
     this.displayForm.UpdateDisplayControl(courtEventArgs.Court);
     PlayerboardLogic.Save(this.playerboard);
 }