private GeocoderResult ParseGeocoderResult(JSONNode resultNode) { BoundingBox bbox = null; string[] bboxArray = resultNode["boundingbox"].Value.Split(','); if (bboxArray.Length == 4) { bbox = new BoundingBox(ParseGeoCoordinate(bboxArray[0], bboxArray[2]), ParseGeoCoordinate(bboxArray[1], bboxArray[3])); } return new GeocoderResult() { PlaceId = long.Parse(resultNode["place_id"].Value), OsmId = long.Parse(resultNode["osm_id"].Value), OsmType = resultNode["osm_type"].Value, DisplayName = resultNode["display_name"].Value, Class = resultNode["class"].Value, Type = resultNode["type"].Value, Coordinate = ParseGeoCoordinate(resultNode["lat"].Value, resultNode["lon"].Value), BoundginBox = bbox, }; }
public override void Add (string aKey, JSONNode aItem) { var tmp = new JSONClass(); tmp.Add(aKey, aItem); Set(tmp); }
public override void Add (JSONNode aItem) { var tmp = new JSONArray(); tmp.Add(aItem); Set(tmp); }
private void Set(JSONNode aVal) { if (_key == null) { _node.Add(aVal); } else { _node.Add(_key, aVal); } _node = null; // Be GC friendly. }
public JSONLazyCreator(JSONNode aNode, string aKey) { _node = aNode; _key = aKey; }
public JSONLazyCreator(JSONNode aNode) { _node = aNode; _key = null; }
public virtual JSONNode Remove(JSONNode aNode) { return aNode; }
public virtual void Add(JSONNode aItem) { Add("", aItem); }
public override JSONNode Remove(JSONNode aNode) { try { var item = _dict.First(k => k.Value == aNode); _dict.Remove(item.Key); return aNode; } catch { return null; } }
public override void Add(string aKey, JSONNode aItem) { if (!string.IsNullOrEmpty(aKey)) { if (_dict.ContainsKey(aKey)) _dict[aKey] = aItem; else _dict.Add(aKey, aItem); } else _dict.Add(Guid.NewGuid().ToString(), aItem); }
public virtual void Add(string aKey, JSONNode aItem){ }
public override JSONNode Remove(JSONNode aNode) { _list.Remove(aNode); return aNode; }
public override void Add(string aKey, JSONNode aItem) { _list.Add(aItem); }