iOS Guides | Samples

MonoTouch.Dialog.JsonElement Class

RootElement that is instantiated from a Json source.

See Also: JsonElement

Syntax

public class JsonElement : RootElement

Remarks

The JsonElement is a sublcass of RootElement that extends a RootElement to be able to load the contents of nested child from a local or remote url.

The JsonElement is a RootElement that can be instantiated in two forms. One version creates a RootElement that will load the contents on demand, these are created by using the JsonElement constructors, which take an extra argument at the end, the url to load the contents from:

c# Example

    var je = new JsonElement ("Dynamic Data", "http://tirania.org/tmp/demo.json");

The other form creates the data from a local file or an existing System.Json.JsonObject that you have already parsed:

c# Example


    var je = JsonElement.FromFile ("json.sample");

    using (var reader = File.OpenRead ("json.sample"))
        return JsonElement.FromJson (JsonObject.Load (reader) as JsonObject, arg);

See the README.markdown included with MonoTouch.Dialog for details on the markup.

Requirements

Namespace: MonoTouch.Dialog
Assembly: MonoTouch.Dialog-1 (in MonoTouch.Dialog-1.dll)
Assembly Versions: 0.0.0.0, 0.0.0.0

The members of MonoTouch.Dialog.JsonElement are listed below.

See Also: RootElement

Public Constructors

Creates a RootElement with its nested content from the contents of the Json file at the specified url.
Creates a RootElement with its nested content from the contents of the Json file at the specified url.
Creates a RootElement with its nested content from the contents of the Json file at the specified url.

Public Fields

UrlString. The url to load if the element is selected.

Public Properties

static
DateKindDateTimeKind.
[read-only]
default property
Item(String)Element. Looks up a specific Element from the Json dictionary which had its "id" property set to the same value as the key

Public Methods

static
FromFile(String) : JsonElement
Creates a RootElement with its nested content from the contents of the Json file at the specified path.
static
FromFile(String, Object) : JsonElement
Creates a RootElement with its nested content from the contents of the Json file at the specified path.
static
FromJson(JsonObject) : JsonElement
Creates a RootElement with its nested content from the contents of the Json object..
static
FromJson(JsonObject, Object) : JsonElement
Creates a RootElement with its nested content from the contents of the Json object..
static
FromJson(JsonElement, JsonObject, Object) : JsonElement
Creates a RootElement with its nested content from the contents of the Json object..