public RegistryKey Probe(RegistryKey rkey, string extra, bool writable) { RegistryKey registryKey = null; Type typeFromHandle = typeof(KeyHandler); RegistryKey result; lock (typeFromHandle) { string text = Path.Combine(this.Dir, extra); KeyHandler keyHandler = (KeyHandler)KeyHandler.dir_to_handler[text]; if (keyHandler != null) { registryKey = new RegistryKey(keyHandler, KeyHandler.CombineName(rkey, extra), writable); KeyHandler.key_to_handler[registryKey] = keyHandler; } else if (Directory.Exists(text)) { keyHandler = new KeyHandler(rkey, text); registryKey = new RegistryKey(keyHandler, KeyHandler.CombineName(rkey, extra), writable); KeyHandler.dir_to_handler[text] = keyHandler; KeyHandler.key_to_handler[registryKey] = keyHandler; } result = registryKey; } return(result); }
public RegistryKey Ensure(RegistryKey rkey, string extra, bool writable) { Type typeFromHandle = typeof(KeyHandler); RegistryKey result; lock (typeFromHandle) { string text = Path.Combine(this.Dir, extra); KeyHandler keyHandler = (KeyHandler)KeyHandler.dir_to_handler[text]; if (keyHandler == null) { keyHandler = new KeyHandler(rkey, text); } RegistryKey registryKey = new RegistryKey(keyHandler, KeyHandler.CombineName(rkey, extra), writable); KeyHandler.key_to_handler[registryKey] = keyHandler; KeyHandler.dir_to_handler[text] = keyHandler; result = registryKey; } return(result); }