private void AddNewQuestionToolStripMenuItem_Click(object sender, EventArgs e) { AddNewQuestion form = new AddNewQuestion(); form.ShowDialog(); using (ForumContainer container = new ForumContainer()) { toolStripQuestionListBox.Items.AddRange( QuestIdentification.questIdentifications(container.QuestionSet .Where(y => y.LanguageLanguageId == this.language.LanguageId)) .Select(x => x.text).ToArray()); } }
public Question(LanguageSet language) { this.language = language; InitializeComponent(); toolStripQuestionListBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; toolStripQuestionListBox.AutoCompleteSource = AutoCompleteSource.ListItems; using (ForumContainer container = new ForumContainer()) { toolStripQuestionListBox.Items.AddRange( QuestIdentification.questIdentifications(container.QuestionSet .Where(y => y.LanguageLanguageId == this.language.LanguageId)) .Select(x => x.text).ToArray()); } }