public bool GetBoolean(string key) { return(EConvert.ToBoolean(this.m_content[key])); }
private static void visit_json_object(StringBuilder sb, string key, object data) { string type_name = null; if (data != null) { type_name = data.GetType().Name; } switch (type_name) { case "SortedList": case "Hashtable": visit_json_dictionary(sb, key, data as IDictionary); break; case "ArrayList": visit_json_list(sb, key, data as IList); break; case "Byte": case "Int16": case "Int32": case "Int64": case "Single": case "Double": if (key == null) { sb.AppendFormat("'{0}'", data); } else { sb.AppendFormat("'{0}':{1}", key, data); } break; case "Boolean": if (key == null) { sb.AppendFormat("'{0}'", data); } else { sb.AppendFormat("'{0}':{1}", key, EConvert.ToBoolean(data) ? "true" : "false"); } break; case "DateTime": if (key == null) { sb.AppendFormat("'{0}'", data); } else { sb.AppendFormat("'{0}':'{1}'", key, data); } break; default: if (key == null) { sb.AppendFormat("'{0}'", escape(data)); } else { sb.AppendFormat("'{0}':'{1}'", key, escape(data)); } break; } }