CombineName() static private method

static private CombineName ( RegistryKey rkey, string extra ) : string
rkey RegistryKey
extra string
return string
Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }