private void Button1Click(object sender, EventArgs e) { if (!VerifyForm()) return; CurrentAns = new Answer { Info = AnswerText.Text, UID = UIDText.Text}; Finished = true; Close(); }
public AddAnsDialog() { CurrentAns = new Answer(); InitializeComponent(); AnswerText.Text = ""; UIDText.Text = ""; }
private void Button2Click(object sender, EventArgs e) { var addAns = new AddAnsDialog(); addAns.ShowDialog(); if (!addAns.Finished) return; var i = new Answer {Info = addAns.CurrentAns.Info, UID = addAns.CurrentAns.UID}; listBox1.Items.Add(i); CurrentQuestion.AnsArray.Add(i); }
private bool SearchItem(Answer input) { return CurrentQuestionSelectedAnswers.Any(i => i == input); }
static bool FindAns(Answer ans, IEnumerable<string> trueAns) { return trueAns.Any(i => ans.UID == i); }