public static bool GetFlagValue(string flagName, bool defaultValue, bool overrideTestIntegrationEnabled) { if (!overrideTestIntegrationEnabled && !MigrationHelperBase.TestIntegrationEnabled) { return(defaultValue); } bool result; using (RegistryKey registryKey = MigrationHelperBase.OpenTestKey(false)) { if (registryKey == null) { result = defaultValue; } else { object value = registryKey.GetValue(flagName); if (value == null || !(value is int)) { result = defaultValue; } else { int num = (int)value; result = (num != 0); } } } return(result); }
public static string GetParamValueStr(string valueName, string defaultValue) { if (!MigrationHelperBase.TestIntegrationEnabled) { return(defaultValue); } string result; using (RegistryKey registryKey = MigrationHelperBase.OpenTestKey(false)) { object value = registryKey.GetValue(valueName); if (value == null || !(value is string)) { result = defaultValue; } else { result = (string)value; } } return(result); }