public void LoadFromDisk() { if (!File.Exists(_filePath)) { return; } var serializer = new XmlSerializer(typeof(ObservableCollection <AppGroup>)); using (var reader = new StreamReader(_filePath)) { AppTimes.Clear(); foreach (var app in (ObservableCollection <AppGroup>)serializer.Deserialize(reader)) { AppTimes.Add(app); } reader.Close(); } foreach (var app in AppTimes) { app.App.LoadIcon(); app.PropertyChanged += Nts_PropertyChanged; foreach (var timeslot in app.Windows) { timeslot.PropertyChanged += app.TimeSlot_PropertyChanged; } } UpdateProps(); }
public void Reset() { AppTimes.Clear(); PropChanged("IncludedTime"); PropChanged("ExcludedTime"); PropChanged("TotalTime"); }