private static string GetBaseKeyName(RegistrySection section) { switch (section) { case RegistrySection.Windows32OnWindows64: return(SoftwareWowKeyName); case RegistrySection.Native: default: return(SoftwareNativeKeyName); } }
public static HashSet <string> LoadStrongNameExclusions(RegistrySection section) { HashSet <string> results = new HashSet <string>(StringComparer.OrdinalIgnoreCase); using (RegistryKey key = OpenReadOnlyVerificationRegistryKey(section)) { if (key != null) { foreach (var subKey in key.GetSubKeyNames()) { results.Add(subKey); } } } return(results); }
public static RegistryKey CreateWritableVerificationRegistryKey(RegistrySection section) { return(CreateWriteableRegistryKey(GetBaseKeyName(section), VerificationSubKeyName)); }
private static RegistryKey OpenReadOnlyVerificationRegistryKey(RegistrySection section) { string keyName = GetBaseKeyName(section) + '\\' + VerificationSubKeyName; return(OpenReadOnlyRegistryKey(keyName)); }