Yesterday the WCF team released a new version of the “WCF Support for jQuery” libraries on codeplex (http://wcf.codeplex.com). Besides some bug fixes, we added some new features to make the JSON API better. Here’s a short list of them:
Events
Similarly to the XElement API, JsonValue now supports events as well, so that a user can register to be notified when a JsonValue instance is modified. Notice that JsonPrimitives are immutable, since we don’t allow the modification of the wrapped CLR object, and all types supported in JsonPrimitive are immutable themselves (numbers, boolean, char, strings, DateTime, DateTimeOffset and Uri). So the event will essentially be raised only on JsonArray and JsonObject instances.
Like the XElement type, JsonValue exposes two events: Changing and Changed. The first is raised when a change is about to be made – and that gives the user some control to prevent the change from happening, like in the example below.
Exposing the wrapped CLR type
Operations and conversions in dynamic notation
Read more: Carlos' blog
Events
Similarly to the XElement API, JsonValue now supports events as well, so that a user can register to be notified when a JsonValue instance is modified. Notice that JsonPrimitives are immutable, since we don’t allow the modification of the wrapped CLR object, and all types supported in JsonPrimitive are immutable themselves (numbers, boolean, char, strings, DateTime, DateTimeOffset and Uri). So the event will essentially be raised only on JsonArray and JsonObject instances.
Like the XElement type, JsonValue exposes two events: Changing and Changed. The first is raised when a change is about to be made – and that gives the user some control to prevent the change from happening, like in the example below.
Exposing the wrapped CLR type
Operations and conversions in dynamic notation
Read more: Carlos' blog