예제 #1
0
        private XElement GetDayToXml(Day day)
        {
            var dayXml = new XElement(Day);
            dayXml.Add(new XElement(DayName, day.Date));

            foreach (var lesson in day.ListOfLessons)
            {
                var lessonXml = GetLessonToXml(lesson);

                dayXml.Add(lessonXml);
            }

            return dayXml;
        }
예제 #2
0
        private Day GetDayFromXml(XElement dayXml)
        {
            var resultDay = new Day
            {
                Date = dayXml.Element(DayName).Value,
                ListOfLessons = new ObservableCollection<Lesson>()
            };

            foreach (var lessonXml in dayXml.Elements(Lesson))
            {
                var resultLesson = GetLessonFromXml(lessonXml);

                resultDay.ListOfLessons.Add(resultLesson);
            }

            return resultDay;
        }
예제 #3
0
 public EditDayWindow(Day day)
 {
     InitializeComponent();
     DataContext = this;
     ResultDays = new ObservableCollection<Day> {day};
 }