예제 #1
0
        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();
        }
예제 #2
0
        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());
            }
        }
예제 #3
0
        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());
            }
        }