private void AddCategories(RegistryKey key) { foreach (string name in key.GetSubKeyNames()) { using (RegistryKey key1 = key.OpenSubKey(name)) { if (key1.SubKeyCount != 0) { this.AddCategories(key1); } } } if (MediaCenterUtil.IsGuid(key.Name.Substring(key.Name.LastIndexOf('\\') + 1))) { return; } OemCategory oemCategory1 = (OemCategory)this.RegistrySerialiser.Deserialise(this.CategoryType, key); OemCategory oemCategory2 = this.managerCategories[oemCategory1.CategoryPath]; if (oemCategory2 != null) { this.RegistrySerialiser.Deserialise((object)oemCategory2, key); } else { if (oemCategory1.QuickLinks.Count <= 0) { return; } this.managerCategories.Add(oemCategory1); } }
protected override void OnAfterDeserialise(RegistrySerialiser rs, RegistryKey key) { List <IQuickLink> list = new List <IQuickLink>(); foreach (string str in key.GetSubKeyNames()) { if (MediaCenterUtil.IsGuid(str)) { using (RegistryKey key1 = key.OpenSubKey(str)) { OemQuickLink l = (OemQuickLink)rs.Deserialise(this.Manager.QuickLinkType, key1); OemQuickLink quickLink = this.GetQuickLink(l); if (quickLink != null) { rs.Deserialise((object)quickLink, key1); list.Add((IQuickLink)quickLink); } else if (l.EntryPoint != null) { if (l.Application != null) { list.Add((IQuickLink)l); } } } } } foreach (IQuickLink quickLink in list) { if (!this.categoryQuickLinks.Contains(quickLink)) { int index = 0; while (index < this.categoryQuickLinks.Count && quickLink.Priority >= this.categoryQuickLinks[index].Priority) { ++index; } this.categoryQuickLinks.Insert(index, quickLink); } } this.categoryName = key.Name.Substring(key.Name.LastIndexOf("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Media Center\\Extensibility\\Categories") + "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Media Center\\Extensibility\\Categories".Length + 1); base.OnAfterDeserialise(rs, key); }