Exemple #1
0
        public void ReadFromXml(XmlReader reader)
        {
            reader.MoveToContent();
            if (reader.IsEmptyElement)
            {
                reader.Read(); return;
            }

            semesterStart = DateTime.Parse(reader.GetAttribute("semesterStart"));

            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsStartElement())
                {
                    if (reader.Name == "weekday")
                    {
                        var weekday = new ScheduleWeekday();
                        weekday.ReadFromXml(reader);
                        weekdays.Add(weekday);
                    }
                    else
                    {
                        reader.Skip();
                    }
                }
                else
                {
                    reader.Read();
                    break;
                }
            }
        }
Exemple #2
0
        public void ReadFromXml(XmlReader reader)
        {
            reader.MoveToContent();
            if (reader.IsEmptyElement) { reader.Read(); return; }

            semesterStart = DateTime.Parse(reader.GetAttribute("semesterStart"));

            reader.Read();
            while (!reader.EOF)
            {
                if (reader.IsStartElement())
                {
                    if (reader.Name == "weekday")
                    {
                        var weekday = new ScheduleWeekday();
                        weekday.ReadFromXml(reader);
                        weekdays.Add(weekday);
                    }
                    else
                    {
                        reader.Skip();
                    }
                }
                else
                {
                    reader.Read();
                    break;
                }
            }
        }