Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        private void btnAddRegexMatch_Click(object sender, RoutedEventArgs e)
        {
            ControlAnswerRegex control = new ControlAnswerRegex();

            listAnswers.Items.Add(control);
        }