SenseNet.ContentRepository.Repository.GetBooleanConfigValue C# (CSharp) Метод

GetBooleanConfigValue() приватный статический Метод

private static GetBooleanConfigValue ( string key, bool defaultValue ) : bool
key string
defaultValue bool
Результат bool
        private static bool GetBooleanConfigValue(string key, bool defaultValue)
        {
            var result = defaultValue;
            var settings = ConfigurationManager.GetSection(PORTALSECTIONKEY) as NameValueCollection;
            if (settings != null)
            {
                var configString = settings[key];
                if (!string.IsNullOrEmpty(configString))
                {
                    bool configVal;
                    if (bool.TryParse(configString, out configVal))
                        result = configVal;
                }
            }

            return result;
        }