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(k => !string.IsNullOrEmpty(k)))
yield return $"{k}||{key.GetValueSafe(k)}";
}
}