/// <summary>Returns REG_SZ registry value with specified name retrieved from admin or user key</summary> /// <param name="isAdminForced">indicates that user key value should be ignored if any</param> /// <param name="name">name associated with value</param> /// <returns>string value associated with given name</returns> private static string GetStringRegistryValue(bool isAdminForced, string name) { if (isAdminForced) { return(AdminSettingsRegistryKey.GetValue(name, null) as string); } return(UserSettingsRegistryKey.GetValue(name, null) as string); }
/// <summary>Receives DWORD registry value associated with specified name retrieved from admin or user key</summary> /// <param name="isAdminForced">indicates that user key value should be ignored if any</param> /// <param name="name">name associated with value</param> /// <returns>numeric value associated with given name</returns> private static int GetIntRegistryValue(bool isAdminForced, string name) { if (isAdminForced) { return((int)AdminSettingsRegistryKey.GetValue(name, 0)); } return((int)UserSettingsRegistryKey.GetValue(name, 0)); }