Inheritance: IRegistryKey
Example #1
0
 public void AddFakeKey(BaseRegistryKey baseKey, MockRegistryKey fakeKey)
 {
     if (!_keyMap.ContainsKey(baseKey))
     {
         _keyMap.Add(baseKey, new List <MockRegistryKey>());
     }
     _keyMap[baseKey].Add(fakeKey);
 }
Example #2
0
 public void AddFakeKey(BaseRegistryKey baseKey, MockRegistryKey fakeKey)
 {
     if (!_keyMap.ContainsKey(baseKey))
     {
         _keyMap.Add(baseKey, new List<MockRegistryKey>());
     }
     _keyMap[baseKey].Add(fakeKey);
 }
Example #3
0
        public IRegistryKey CreateSubKey(BaseRegistryKey baseKey, string name)
        {
            if (!_keyMap.ContainsKey(baseKey))
            {
                _keyMap.Add(baseKey, new List<MockRegistryKey>());
            }

            foreach (MockRegistryKey key in _keyMap[baseKey])
            {
                if (key.Name.Equals(name,StringComparison.InvariantCultureIgnoreCase))
                {
                    return key;
                }
            }

            MockRegistryKey newKey = new MockRegistryKey(name);
            _keyMap[baseKey].Add(newKey);
            return newKey;
        }
Example #4
0
        public IRegistryKey CreateSubKey(BaseRegistryKey baseKey, string name)
        {
            if (!_keyMap.ContainsKey(baseKey))
            {
                _keyMap.Add(baseKey, new List <MockRegistryKey>());
            }

            foreach (MockRegistryKey key in _keyMap[baseKey])
            {
                if (key.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase))
                {
                    return(key);
                }
            }

            MockRegistryKey newKey = new MockRegistryKey(name);

            _keyMap[baseKey].Add(newKey);
            return(newKey);
        }