private void _parseElement(JsonObject json, Section section, JsonValue data)
{
string type = "Unknown";
try {
type = json["type"];
if (type == "HiddenElement")
{
var name = json.asString("id");
_controller.SetValue(name, data == null? json.asString("value") : data.CleanString());
}
else
{
string id = (json.ContainsKey("id") ? json["id"] : null);
var newElement = ElementParsers.Parsers[type](json, _controller, data);
if (newElement != null)
{
if (!string.IsNullOrEmpty(id))
{
newElement.ID = new NSString(id);
}
section.Add(newElement);
}
}
} catch (Exception e) {
Console.WriteLine("Problem parsing element. Element was skipped. Type: " + type + " = " + e.ToString());
}
}