-Added JsonSerializer argument to JsonConverter.ReadJson and JsonConverter.WriteJson. Needed because serializer now has state

-Added CustomCreationConverter
-Added IsReference to JsonContainerAttribute
-Added PreserveReferencesHandling to JsonSerializer
-Added IReferenceResolver to JsonSerializer
-Split internals of JsonSerializer into JsonSerializerWriter (serializes) and JsonSerializerReader (deserializes)
-Moved serialize stack from JsonWriter (yuck) to JsonSerializerWriter (yay)
-Added FromObject overload with JsonSerializer argument for cases when state is needed
This commit is contained in:
JamesNK
2009-05-13 10:15:41 +00:00
parent 3b26adfdd1
commit f0c5be266b
41 changed files with 2467 additions and 717 deletions
@@ -484,7 +484,7 @@ namespace Newtonsoft.Json.Utilities
}
}
public static IList CreateAndPopulateList(Type listType, Action<IList> populateList)
public static IList CreateAndPopulateList(Type listType, Action<IList, bool> populateList)
{
ValidationUtils.ArgumentNotNull(listType, "listType");
ValidationUtils.ArgumentNotNull(populateList, "populateList");
@@ -549,7 +549,7 @@ namespace Newtonsoft.Json.Utilities
if (list == null)
throw new Exception("Cannot create and populate list type {0}.".FormatWith(CultureInfo.InvariantCulture, listType));
populateList(list);
populateList(list, isReadOnlyOrFixedSize);
// create readonly and fixed sized collections using the temporary list
if (isReadOnlyOrFixedSize)