コード例 #1
0
ファイル: QuestionTest.cs プロジェクト: 24/source_04
        public static IEnumerable <QuestionData> Test_ReadQuestionFilesAsQuestionData_v2(string directory, int limit = 0)
        {
            directory = zPath.Combine(XmlConfig.CurrentConfig.GetExplicit("CardDirectory"), directory);
            //TextDataReader textDataReader = new TextDataReader(QuestionsManager.GetScanFiles(directory, limit));
            TextDataReader textDataReader = new TextDataReader();

            textDataReader.SetRegexList(CreateQuestionRegexValuesList());
            foreach (QuestionData value in textDataReader.Read(QuestionsManager.GetScanFiles(zPath.Combine(directory, @"data\scan"), limit)).Select(textData => QuestionData.CreateQuestionData(textData)))
            {
                if (value.Type == QuestionDataType.Responses)
                {
                    //Trace.WriteLine("read responses");
                    textDataReader.SetRegexList(CreateResponseRegexValuesList());
                    textDataReader.ContiguousSearch = true;
                }
                yield return(value);
            }
        }
コード例 #2
0
ファイル: QuestionTest.cs プロジェクト: 24/source_04
 public static IEnumerable <QuestionData> Test_ReadQuestionFilesAsQuestionData(string directory, int limit = 0)
 {
     return(Test_ReadQuestionFiles(directory, limit).Select(textData => QuestionData.CreateQuestionData(textData)));
 }