Upravit

Sdílet prostřednictvím


JsonElement Class

Definition

RootElement that is instantiated from a Json source.

public class JsonElement : MonoTouch.Dialog.RootElement
type JsonElement = class
    inherit RootElement
Inheritance
JsonElement

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:

var je = new JsonElement ("Dynamic Data", "https://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:


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.

Constructors

JsonElement(String, Group, String)

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

JsonElement(String, Int32, Int32, String)

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

JsonElement(String, String)

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

Fields

Caption

The caption to display for this given element

(Inherited from Element)
createOnSelected

Delegate invoked when the RootElement is tapped.

(Inherited from RootElement)
NeedColorUpdate

Set to direct the DialogViewController to call the WillDisplay method on cells that implement IColorizeBackground.

(Inherited from RootElement)
Parent

Handle to the container object.

(Inherited from Element)
TableView

The UITableView that is rendering the current RootElement.

(Inherited from RootElement)
UnevenRows

Reports whether the rows have all the same size or not.

(Inherited from RootElement)
Url

The url to load if the element is selected.

Properties

CellKey

Subclasses that override the GetCell method should override this method as well

(Inherited from Element)
Count

Number of sections in this RootElement.

(Inherited from RootElement)
DateKind
IndexPath

Returns the IndexPath of a given element. This is only valid for leaf elements, it does not work for a toplevel RootElement or a Section of if the Element has not been attached yet.

(Inherited from Element)
Item[Int32]

Returns the section at the specified index.

(Inherited from RootElement)
Item[String]

Looks up a specific Element from the Json dictionary which had its "id" property set to the same value as the key

RadioSelected

The currently selected Radio item in the whole Root.

(Inherited from RootElement)

Methods

Add(IEnumerable<Section>)

Adds all of the sections in the IEnumerable to this root element.

(Inherited from RootElement)
Add(Section)

Adds a new section to this RootElement

(Inherited from RootElement)
Clear()

Removes all the sections from this RootElement.

(Inherited from RootElement)
Deselected(DialogViewController, UITableView, NSIndexPath) (Inherited from Element)
Dispose() (Inherited from Element)
Dispose(Boolean)

Releases the resources held by this RootElement and its children.

(Inherited from RootElement)
FromFile(String, Object)

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

FromFile(String)

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

FromJson(JsonElement, JsonObject, Object)

Creates a RootElement with its nested content from the contents of the Json object..

FromJson(JsonObject, Object)

Creates a RootElement with its nested content from the contents of the Json object..

FromJson(JsonObject)

Creates a RootElement with its nested content from the contents of the Json object..

GetActiveCell() (Inherited from Element)
GetCell(UITableView)
GetContainerTableView() (Inherited from Element)
GetImmediateRootElement()

If the cell is attached will return the immediate RootElement

(Inherited from Element)
Insert(Int32, Section)

Inserts a new section into the RootElement

(Inherited from RootElement)
Insert(Int32, UITableViewRowAnimation, Section[]) (Inherited from RootElement)
MakeViewController() (Inherited from RootElement)
Matches(String)

Method invoked to determine if the cell matches the given text, never invoked with a null value or an empty string.

(Inherited from Element)
Prepare() (Inherited from RootElement)
PrepareDialogViewController(UIViewController) (Inherited from RootElement)
Reload(Element, UITableViewRowAnimation) (Inherited from RootElement)
Reload(Section, UITableViewRowAnimation) (Inherited from RootElement)
Remove(Section, UITableViewRowAnimation) (Inherited from RootElement)
Remove(Section)

Removes the specified section from this RootElement using the default animation.

(Inherited from RootElement)
RemoveAt(Int32, UITableViewRowAnimation) (Inherited from RootElement)
RemoveAt(Int32)

Removes a section at a specified location using the default animation.

(Inherited from RootElement)
Selected(DialogViewController, UITableView, NSIndexPath)
Summary()

Returns a summary of the value represented by this object, suitable for rendering as the result of a RootElement with child objects.

(Inherited from Element)

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Enumerator that returns all the sections in the RootElement.

(Inherited from RootElement)
IEnumerable<Section>.GetEnumerator()

Enumerator that returns all the sections in this RootElement.

(Inherited from RootElement)

Applies to