Scalien.ConfigFile.GetBoolValue C# (CSharp) Method

GetBoolValue() public method

public GetBoolValue ( string key, bool defaultValue ) : bool
key string
defaultValue bool
return bool
        public bool GetBoolValue(string key, bool defaultValue)
        {
            string stringValue = GetStringValue(key);
            if (stringValue == null)
                return defaultValue;

            if (stringValue == "true" || stringValue == "yes" || stringValue == "on")
                return true;

            if (stringValue == "false" || stringValue == "no" || stringValue == "off")
                return false;

            throw new FormatException();
        }