Пример #1
0
        private List <Question2> GetQuestionFromTxt(string fileName)//TODO: correctAnswers
        {
            List <Question2> questions = new List <Question2>();
            int index = 0;



            using (StreamReader reader = new StreamReader(EmbeddedResource.GetAsStream(Assembly.GetExecutingAssembly(), fileName)))
                while (true)
                {
                    string line = reader.ReadLine();
                    if (line == null)
                    {
                        break;
                    }

                    questions.Add(new Question2(index, Name, line, CorrectAnswers[index]));
                    index++;
                }

            return(questions);
        }