public ExcerciseVM()
        {
            XDocument xmlQuestionDocument = XDocument.Load(Path.Combine(Environment.CurrentDirectory, @"Content\Excercises.xml"));

            Excercises     = new List <ExcerciseEntity>();
            ExcerciseNames = new List <string>();
            var excercises = from a in xmlQuestionDocument.Elements("Excercises")
                             select a;

            foreach (var item in excercises.Elements())
            {
                ExcerciseEntity excercise = new ExcerciseEntity
                {
                    Name    = item.Element("Name").Value,
                    Content = item.Element("Content").Value,
                    Type    = (ExcerciseTypes)Enum.Parse(typeof(ExcerciseTypes), item.Element("Type").Value)
                };
                Excercises.Add(excercise);
                ExcerciseNames.Add(excercise.Name);
            }
        }
Beispiel #2
0
 public ExcerciseRepository()
 {
     excerciseEntity = new ExcerciseEntity();
 }