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; }
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; }
private void btnFilterWords_Click(object sender, EventArgs e) { AvailableWords.RemoveAll((s) => WordsData.countSimilarities(s, cmbWordSelect.Text) != nudCharacterMatches.Value); lblNextGuessValue.Text = data.getNextGuess(AvailableWords); bsWords.ResetBindings(false); }