public static ControlForensicQuestion Parse(BinaryReader reader) { ControlForensicQuestion control = new ControlForensicQuestion(); control.Path = reader.ReadString(); control.AnswerPrefix = reader.ReadString(); control.Title = reader.ReadString(); int count = reader.ReadInt32(); for (int i = 0; i < count; i++) { IAnswer answer = null; EAnswerType type = (EAnswerType)reader.ReadInt32(); string info = reader.ReadString(); switch (type) { case EAnswerType.Text: answer = new ControlAnswerText(); break; case EAnswerType.Regex: answer = new ControlAnswerRegex(); break; } if (answer == null) { continue; } answer.Info = info; control.listAnswers.Items.Add(answer); } return(control); }
private void btnAddTextMatch_Click(object sender, RoutedEventArgs e) { ControlAnswerText control = new ControlAnswerText(); listAnswers.Items.Add(control); }