New features

-New, more concise, LINQ to JSON querying syntax.
-Added FromObject to JObject, JArray.
-JToken WriteTo method now supports JsonConverters.
-JsonSerializer supports serializing to and from LINQ to JSON objects.
-JsonSerializer properly serializes IEnumerable objects.
-Added Depth property to JsonReader.

Changes
-Made JsonReader and JsonWriter abstract. Added JsonTextReader/JsonNodeReader and JsonTextWriter/JsonNodeWriter.
-Removed JavaScriptObject, JavaScriptArray. Replaced by LINQ to JSON objects.
This commit is contained in:
JamesNK
2008-03-02 03:25:47 +00:00
parent 82e86cdcc7
commit 8a64988cb6
24 changed files with 2227 additions and 1341 deletions
+15 -2
View File
@@ -77,16 +77,29 @@ namespace Newtonsoft.Json.Linq
}
}
public override void WriteTo(JsonWriter writer)
public override void WriteTo(JsonWriter writer, params JsonConverter[] converters)
{
writer.WriteStartConstructor(_name);
foreach (JToken token in Children())
{
token.WriteTo(writer);
token.WriteTo(writer, converters);
}
writer.WriteEndConstructor();
}
public override JToken this[object key]
{
get
{
ValidationUtils.ArgumentNotNull(key, "o");
if (!(key is int))
throw new ArgumentException(string.Format("Accessed JConstructor values with invalid key value: {0}. Argument position index expected.", MiscellaneousUtils.ToString(key)));
return GetIndex(this, (int)key);
}
}
}
}