private static bool SerializeValue(IJsonSerializerStrategy jsonSerializerStrategy, object value, StringBuilder builder) { bool flag = true; string text = value as string; if (text != null) { flag = SimpleJsonTool.SerializeString(text, builder); } else { IDictionary <string, object> dictionary = value as IDictionary <string, object>; if (dictionary != null) { flag = SimpleJsonTool.SerializeObject(jsonSerializerStrategy, dictionary.Keys, dictionary.Values, builder); } else { IDictionary <string, string> dictionary2 = value as IDictionary <string, string>; if (dictionary2 != null) { flag = SimpleJsonTool.SerializeObject(jsonSerializerStrategy, dictionary2.Keys, dictionary2.Values, builder); } else { IEnumerable enumerable = value as IEnumerable; if (enumerable != null) { flag = SimpleJsonTool.SerializeArray(jsonSerializerStrategy, enumerable, builder); } else if (SimpleJsonTool.IsNumeric(value)) { flag = SimpleJsonTool.SerializeNumber(value, builder); } else if (value is bool) { builder.Append((!(bool)value) ? "false" : "true"); } else if (value == null) { builder.Append("null"); } else { object value2; flag = jsonSerializerStrategy.TrySerializeNonPrimitiveObject(value, out value2); if (flag) { SimpleJsonTool.SerializeValue(jsonSerializerStrategy, value2, builder); } } } } } return(flag); }