ContainsBoolean() public method

public ContainsBoolean ( string key ) : bool
key string
return bool
Ejemplo n.º 1
0
        /// <summary>
        /// Returns the boolean alias first from this IConfig then
        /// the parent if there is none.
        /// </summary>
        private bool GetBooleanAlias(string key)
        {
            bool result = false;

            if (aliasText.ContainsBoolean(key))
            {
                result = aliasText.GetBoolean(key);
            }
            else
            {
                if (ConfigSource.Alias.ContainsBoolean(key))
                {
                    result = ConfigSource.Alias.GetBoolean(key);
                }
                else
                {
                    throw new ArgumentException
                              ("Alias value not found: " + key
                              + ". Add it to the Alias property.");
                }
            }

            return(result);
        }