Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
WereDev committed Jun 23, 2018
2 parents 642ba33 + 066fa34 commit aa19114
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Wu10Man/Editors/RegistryEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,20 @@ private static void WriteRegistryValue(RegistryKey registryRoot, string registry
if (String.IsNullOrWhiteSpace(registryKey)) throw new ArgumentNullException(nameof(registryKey));
if (String.IsNullOrWhiteSpace(registryName)) throw new ArgumentNullException(nameof(registryName));

using (var regKey = registryRoot.OpenSubKey(registryKey, true))
using (var regKey = OpenOrCreateRegistryKey(registryRoot, registryKey, true))
{
regKey.SetValue(registryName, registryValue, registryValueKind);
}
}

private static RegistryKey OpenOrCreateRegistryKey(RegistryKey registryRoot, string registryKey, bool writable)
{
var regKey = registryRoot.OpenSubKey(registryKey);
if (regKey == null)
regKey = registryRoot.CreateSubKey(registryKey, writable);
return regKey;
}

private static void DeleteRegistryValue(RegistryKey registryRoot, string registryKey, string registryName)
{
if (registryRoot == null) throw new ArgumentNullException(nameof(registryRoot));
Expand Down

0 comments on commit aa19114

Please sign in to comment.