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); }
public static Question Parse(BinaryReader reader) { Question question = new Question(); question.Path = reader.ReadString(); question.AnswerPrefix = reader.ReadString(); question.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 AnswerText(); break; case EAnswerType.Regex: answer = new AnswerRegex(); break; } if (answer == null) { continue; } answer.Info = info; question.Answers.Add(answer); } return(question); }
public JhhException(EAnswerType _type, string _str) : base(_str) { AnswerType = _type; }