Esempio n. 1
0
        private void editWords(ComboBox cmbSelector)
        {
            frmEdit editor = new frmEdit();

            if (data != null) {
                editor.txtWords.Lines = data.Words.ToArray();
            }

            DialogResult r = editor.ShowDialog();
            if (r != System.Windows.Forms.DialogResult.OK) return;

            int? wordLength = editor.wordLength;
            data = new WordsData(editor.words);

            AvailableWords.Clear();
            AvailableWords.AddRange(editor.words);
            bsWords.ResetBindings(false);

            cmbSelector.Items.Clear();
            cmbSelector.Items.AddRange(AvailableWords.ToArray());
            cmbSelector.Items.Add(editItem);

            lblNextGuessValue.Text = data.getNextGuess(AvailableWords);

            nudCharacterMatches.Maximum = wordLength.HasValue ? wordLength.Value : 0;
        }
Esempio n. 2
0
        private void editWords(ComboBox cmbSelector)
        {
            frmEdit editor = new frmEdit();

            if (data != null)
            {
                editor.txtWords.Lines = data.Words.ToArray();
            }

            DialogResult r = editor.ShowDialog();

            if (r != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            int?wordLength = editor.wordLength;

            data = new WordsData(editor.words);

            AvailableWords.Clear();
            AvailableWords.AddRange(editor.words);
            bsWords.ResetBindings(false);

            cmbSelector.Items.Clear();
            cmbSelector.Items.AddRange(AvailableWords.ToArray());
            cmbSelector.Items.Add(editItem);

            lblNextGuessValue.Text = data.getNextGuess(AvailableWords);

            nudCharacterMatches.Maximum = wordLength.HasValue ? wordLength.Value : 0;
        }