public void Transfer() { _beaconData = JObject.Parse(_content); foreach (var data in _beaconData["features"]) { BeaconData.Beacon beacon = new BeaconData.Beacon(); beacon.Coordinate_X = (string)data["geometry"]["coordinates"][0]; beacon.Coordinate_Y = (string)data["geometry"]["coordinates"][1]; beacon.Level = (string)data["properties"]["Level"]; beacon.UUID = (string)data["properties"]["GUID"]; beacon.Coverage = (string)data["properties"]["Type"]; beacon.Used = false; BeaconData.Beacons.Add(beacon); } }
public void Transfer() { var nodes = _xdoc.Descendants("features"); foreach (var node in nodes) { BeaconData.Beacon beacon = new BeaconData.Beacon(); var coordinates = node.Element("geometry").Elements("coordinates").ToList(); beacon.Coordinate_X = (string)coordinates[0]; beacon.Coordinate_Y = (string)coordinates[1]; beacon.Level = (string)node.Element("properties").Element("Level"); beacon.UUID = (string)node.Element("properties").Element("GUID"); beacon.Coverage = (string)node.Element("properties").Element("Type"); beacon.Used = false; BeaconData.Beacons.Add(beacon); } }