private static MockRegistryKey Find(List <MockRegistryKey> topKeys, string fullKey) { Stack <string> s = CreateStack(fullKey); if (s.Count() == 0) { return(null); } string k = s.Pop(); // HKEY_LOCAL_MACHINE var existing = topKeys.Where(m => m.ShortName == k); MockRegistryKey topKey = null; if (existing.Count() > 0) { topKey = existing.First(); } if (s.Count() == 0) { return(topKey); } else { return(topKey.Find(s)); } }
private MockRegistryKey Find(Stack <string> s) { if (s.Count() == 0) { return(null); } string k = s.Pop(); var existing = this.subKeys.Where(m => m.ShortName == k); MockRegistryKey topKey = null; if (existing.Count() > 0) { topKey = existing.First(); } if (s.Count() == 0) { return(topKey); } else { return(topKey.Find(s)); } }