private void RecurseSubKeys(string regPath) { var regEntry = new RegistryEntry(regPath); if (regEntry.RegistryKey == null) { return; } var alreadyAdded = RegistryEntries.Contains(regEntry); if (alreadyAdded) { regEntry = RegistryEntries[RegistryEntries.IndexOf(regEntry)]; } // Add all values regEntry.AddValues(); if (!alreadyAdded) { RegistryEntries.Add(regEntry); } foreach (var subKeyPath in regEntry.RegistryKey.GetSubKeyNames().Select(subKey => regPath + "\\" + subKey)) { RecurseSubKeys(subKeyPath); } }
public bool Store(BadRegistryKey brk) { var regEntry = new RegistryEntry(brk.RegKeyPath); if (!string.IsNullOrEmpty(brk.ValueName)) { if (RegistryEntries.Contains(regEntry)) { regEntry = RegistryEntries[RegistryEntries.IndexOf(regEntry)]; return(regEntry.AddValue(brk.ValueName)); } var ret = regEntry.AddValue(brk.ValueName); RegistryEntries.Add(regEntry); return(ret); } // Recurse subkeys RecurseSubKeys(brk.RegKeyPath); return(true); }
public int IndexOf(RegistryEntry val) { return(RegEntries.IndexOf(val)); }
public void Add(RegistryEntry val) { RegEntries.Add(val); }
public bool Contains(RegistryEntry val) { return(RegEntries.Contains(val)); }