public void Reset() { this.managerApps = new OemManager.ApplicationCollection(this); this.managerEntryPoints = new OemManager.EntryPointCollection(this); this.managerCategories = new OemManager.CategoryCollection(this); List <OemMenuStrip> list = new List <OemMenuStrip>(); this.managerDeletedStrips = new List <OemMenuStrip>(); this.managerRs = MediaCenterRegistryObject.CreateRegistrySerialiser(this); this.BuildInfo((ICollection <OemMenuStrip>)list); this.isDirty = false; list.Sort((Comparison <OemMenuStrip>)((x, y) => y.TimeStamp.CompareTo(x.TimeStamp))); this.managerStrips = new ObservableCollection <OemMenuStrip>(list); this.managerStrips.CollectionChanged += new NotifyCollectionChangedEventHandler(this.Strips_CollectionChanged); }
private static void IsDirtyPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) { MediaCenterRegistryObject centerRegistryObject = (MediaCenterRegistryObject)sender; centerRegistryObject.OnIsDirtyChanged(EventArgs.Empty); if (centerRegistryObject.Manager == null) { return; } if ((bool)args.NewValue) { if (centerRegistryObject.Manager.DirtyObjects.Contains(centerRegistryObject)) { return; } centerRegistryObject.Manager.DirtyObjects.Add(centerRegistryObject); } else { centerRegistryObject.Manager.DirtyObjects.Remove(centerRegistryObject); } }