Microsoft.Win32.RegistryKey.DeleteSubKeyCore C# (CSharp) Method

DeleteSubKeyCore() private method

private DeleteSubKeyCore ( string subkey, bool throwOnMissingSubKey ) : void
subkey string
throwOnMissingSubKey bool
return void
        private void DeleteSubKeyCore(string subkey, bool throwOnMissingSubKey)
        {
            int ret = Interop.Advapi32.RegDeleteKeyEx(_hkey, subkey, (int)_regView, 0);

            if (ret != 0)
            {
                if (ret == Interop.Errors.ERROR_FILE_NOT_FOUND)
                {
                    if (throwOnMissingSubKey)
                    {
                        ThrowHelper.ThrowArgumentException(SR.Arg_RegSubKeyAbsent);
                    }
                }
                else
                {
                    Win32Error(ret, null);
                }
            }
        }