示例#1
0
        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);
            }
        }
示例#2
0
        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);
        }
示例#3
0
 public int IndexOf(RegistryEntry val)
 {
     return(RegEntries.IndexOf(val));
 }
示例#4
0
 public void Add(RegistryEntry val)
 {
     RegEntries.Add(val);
 }
示例#5
0
 public bool Contains(RegistryEntry val)
 {
     return(RegEntries.Contains(val));
 }