Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }