mirror of https://github.com/quasar/Quasar.git
Fixed registry key access (#256)
This commit is contained in:
parent
f1934058a0
commit
253507a613
|
@ -54,7 +54,7 @@ public static RegistryKey OpenReadonlySubKeySafe(this RegistryKey key, string na
|
|||
{
|
||||
try
|
||||
{
|
||||
return Registry.LocalMachine.OpenSubKey(name, false);
|
||||
return key.OpenSubKey(name, false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ public static RegistryKey OpenReadonlySubKeySafe(this RegistryKey key, string na
|
|||
/// unable to obtain a sub-key.</returns>
|
||||
public static RegistryKey OpenWritableSubKey(this RegistryKey key, string name)
|
||||
{
|
||||
return Registry.LocalMachine.OpenSubKey(name, true);
|
||||
return key.OpenSubKey(name, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -85,7 +85,7 @@ public static IEnumerable<string> GetFormattedKeyValues(this RegistryKey key)
|
|||
{
|
||||
if (key == null) yield break;
|
||||
|
||||
foreach (var k in key.GetValueNames().Where(keyVal => !keyVal.IsNameOrValueNull(key)).Where(string.IsNullOrEmpty))
|
||||
foreach (var k in key.GetValueNames().Where(keyVal => !keyVal.IsNameOrValueNull(key)).Where(k => !string.IsNullOrEmpty(k)))
|
||||
{
|
||||
yield return string.Format("{0}||{1}", k, key.GetValueSafe(k));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue