public void DeleteKey(RegistryKey rkey, string keyName, bool shouldThrowWhenKeyMissing)
{
IntPtr handle = Win32RegistryApi.GetHandle(rkey);
int num = Win32RegistryApi.RegDeleteKey(handle, keyName);
if (num != 2)
{
if (num != 0)
{
this.GenerateException(num);
}
return;
}
if (shouldThrowWhenKeyMissing)
{
throw new ArgumentException("key " + keyName);
}
}