private void Load() { this.ProgramActivities.Clear(); if (File.Exists(this.DataFilePath)) { XmlDocument document = new XmlDocument(); document.Load(this.DataFilePath); XmlNode node = document.SelectSingleNode(@"/Programs"); if (node != null) { foreach (XmlNode childNode in node.ChildNodes) { ProgramActivity programActivity = new ProgramActivity(this); programActivity.Deserialize(childNode); if (this.Station.Programs.Where(x => x.Id.Equals(programActivity.ProgramLink)).Count() == 0 && !programActivity.ProgramLink.Equals(Guid.Empty)) programActivity.Clear(); ApplyPrograms(programActivity); this.ProgramActivities.Add(programActivity); } } if (this.ProgramActivities.Count == 0) { InitDay(); Save(); } } else { InitDay(); Save(); } this.ProgramActivities.Sort((x, y) => x.Time.CompareTo(y.Time)); this.DataNotSaved = false; }