internal static Coordinates FromJson(VkResponse response) { // TODO: TEST IT!!!!! var latitudeWithLongitude = ((string)response).Split(' '); if (latitudeWithLongitude.Length != 2) throw new VkApiException("Coordinates must have latitude and longitude!"); double latitude; if (!double.TryParse(latitudeWithLongitude[0].Replace(".", ","), out latitude)) throw new VkApiException("Invalid latitude!"); double longitude; if (!double.TryParse(latitudeWithLongitude[1].Replace(".", ","), out longitude)) throw new VkApiException("Invalid longitude!"); var coordinates = new Coordinates { Latitude = latitude, Longitude = longitude }; return coordinates; }