private void toolStripQuestionListBox_SelectedIndexChanged(object sender, EventArgs e) { var selectitem = (string)toolStripQuestionListBox.SelectedItem; var item = QuestIdentification.Get(selectitem); using (ForumContainer container = new ForumContainer()) { QuestionSet = container.QuestionSet.FirstOrDefault(x => x.QuestionId == item.id); } QuestionLabel.Text = item.text; contextMenuStrip.Close(); }
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()); } }