コード例 #1
0
ファイル: frmMain.cs プロジェクト: adituv/FalloutTerminal
        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;
        }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: adituv/FalloutTerminal
        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;
        }
コード例 #3
0
ファイル: frmMain.cs プロジェクト: adituv/FalloutTerminal
 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);
 }