BlackHole.Slave.Helper.RegistryHelper.OpenWritableSubKeySafe C# (CSharp) Method

OpenWritableSubKeySafe() public static method

public static OpenWritableSubKeySafe ( this key, string name, bool>.Func onSuccess ) : bool
key this
name string
onSuccess bool>.Func
return bool
        public static bool OpenWritableSubKeySafe(this RegistryKey key, string name, Func<RegistryKey, bool> onSuccess)
        {
            try
            {
                using (var subKey = key.OpenSubKey(name, true))
                {
                    if (subKey == null)
                        return false;
                    return onSuccess(subKey);
                }
            }
            catch
            {
                return false;
            }
        }