private RouteSearchRequest(MapService service, ServiceRequestType type) : base(service, type) { // The Maps Service invokes this callback while iterating through the set of obtained Routes. _routeCallback = (result, id, index, total, route, userData) => { errorCode = result; if (result.IsSuccess()) { // The parameter route must be released using maps_route_destroy(). var routeHandle = new Interop.RouteHandle(route, needToRelease: true); _routeList.Add(new Route(routeHandle)); if (_routeList.Count == total) { _requestTask?.TrySetResult(_routeList); } return(true); } else { // If search is failed, the value of total is 0 and route is NULL. _requestTask?.TrySetException(errorCode.GetException(errMessage)); return(false); } }; }
private GeocodeRequest(MapService service, ServiceRequestType type) : base(service, type) { // The Maps Service invokes this callback while iterating through the list of obtained coordinates of the specified place. _geocodeCallback = (result, id, index, total, coordinates, userData) => { errorCode = result; if (result.IsSuccess()) { // The parameter coordinates must be released using maps_coordinates_destroy() var coordinatesHandle = new Interop.CoordinatesHandle(coordinates, needToRelease: true); _coordinateList.Add(new Geocoordinates(coordinatesHandle)); if (_coordinateList.Count == total) { _requestTask?.TrySetResult(_coordinateList); } return(true); } else { // If the search fails, the value of total is 0 and coordinates is NULL. _requestTask?.TrySetException(result.GetException(errMessage)); return(false); } }; }
/// <summary> /// Checks if the maps service supports the given request. /// </summary> /// <since_tizen> 3 </since_tizen> /// <param name="type">Request type to check</param> /// <returns>Returns true if the maps service supports a request, otherwise false.</returns> /// <privilege>http://tizen.org/privilege/mapservice</privilege> /// <exception cref="System.NotSupportedException">Thrown when the required feature is not supported.</exception> /// <exception cref="System.UnauthorizedAccessException">Thrown when application does not have some privilege to access this method.</exception> public bool IsSupported(ServiceRequestType type) { bool result = false; var err = handle.IsServiceSupported((Interop.ServiceType)type, out result); err.WarnIfFailed($"Failed to get if {type} is supported"); return((err.IsSuccess()) ? result : false); }
public ServiceResponse(ServiceRequestType serviceRequestType) { RequestType = serviceRequestType; }
/// <summary> /// Creates a map service request. /// </summary> /// <param name="service">Map service object.</param> /// <param name="type">Request type.</param> internal MapServiceRequest(MapService service, ServiceRequestType type) { _service = service; _type = type; }