public bool GetBoolean() { string v = GetString(); switch (v) { case "on": return true; case "off": return false; case "true": return true; case "false": return false; default: throw new NotSupportedException("Unknown boolean format: " + v); } }