src/Microsoft/Windows/Registry/_Library/ExtensionMethods_IRegistryKey.cs
/// <summary>
/// Tests, if a given subkey of the current registry key is empty.
/// </summary>
/// <param name="registryKey">The extended registry key instance</param>
/// <param name="subKey">The name of the subkey to test.</param>
/// <returns>true, if the given subkey was not found or the subkey has no subkeys and no values. returns false otherwise.</returns>
Tests, if a given subkey of the current registry key is empty.
Tests if a given subkey of the current registry key is empty .
[DebuggerStepThrough]
        public static bool SubKeyIsEmpty( this IRegistryKey registryKey, string subKey ) {
            bool result = true;
            using( IRegistryKey key = registryKey.OpenSubKey( subKey ) ) {
                if( null == key ) {
                    return true;
                }
                result = key.IsEmpty();
                key.Close();
            }
            return result;
        }
[ DebuggerStepThrough ] public static bool SubKeyIsEmpty ( this IRegistryKey registryKey , string subKey ) { bool result = true ; using ( IRegistryKey key = registryKey . OpenSubKey ( subKey ) ) { if ( null == key ) { return true ; } result = key . IsEmpty ( ) ; key . Close ( ) ; } return result ; }
Tests, if a given subkey of the current registry key is empty.
Tests if a given subkey of the current registry key is empty .
true, if the given subkey was not found or the subkey has no subkeys and no values. returns false otherwise.
true if the given subkey was not found or the subkey has no subkeys and no values . returns false otherwise .
IRegistryKey
this
subKey
string
The name of the subkey to test.
The name of the subkey to test .
registryKey
The extended registry key instance
The extended registry key instance